Rename GerritUiOptions to GerritOptions
This will allow this class to be used for more than just UI. Change-Id: Ic8db0d8a93a0e84b9834aba3cd61584836e896c0
This commit is contained in:
parent
f54fc13ac7
commit
6b60160dda
@ -14,10 +14,10 @@
|
||||
|
||||
package com.google.gerrit.httpd;
|
||||
|
||||
public class GerritUiOptions {
|
||||
public class GerritOptions {
|
||||
private final boolean headless;
|
||||
|
||||
public GerritUiOptions(boolean headless) {
|
||||
public GerritOptions(boolean headless) {
|
||||
this.headless = headless;
|
||||
}
|
||||
|
@ -63,11 +63,11 @@ class UrlModule extends ServletModule {
|
||||
}
|
||||
|
||||
private final UrlConfig cfg;
|
||||
private GerritUiOptions uiOptions;
|
||||
private GerritOptions options;
|
||||
|
||||
UrlModule(UrlConfig cfg, GerritUiOptions uiOptions) {
|
||||
UrlModule(UrlConfig cfg, GerritOptions options) {
|
||||
this.cfg = cfg;
|
||||
this.uiOptions = uiOptions;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -75,7 +75,7 @@ class UrlModule extends ServletModule {
|
||||
filter("/*").through(Key.get(CacheControlFilter.class));
|
||||
bind(Key.get(CacheControlFilter.class)).in(SINGLETON);
|
||||
|
||||
if (uiOptions.enableDefaultUi()) {
|
||||
if (options.enableDefaultUi()) {
|
||||
serve("/").with(HostPageServlet.class);
|
||||
serve("/Gerrit").with(LegacyGerritServlet.class);
|
||||
serve("/Gerrit/*").with(legacyGerritScreen());
|
||||
|
@ -50,18 +50,18 @@ public class WebModule extends LifecycleModule {
|
||||
private final UrlModule.UrlConfig urlConfig;
|
||||
private final boolean wantSSL;
|
||||
private final GitWebConfig gitWebConfig;
|
||||
private final GerritUiOptions uiOptions;
|
||||
private final GerritOptions options;
|
||||
|
||||
@Inject
|
||||
WebModule(final AuthConfig authConfig,
|
||||
final UrlModule.UrlConfig urlConfig,
|
||||
@CanonicalWebUrl @Nullable final String canonicalUrl,
|
||||
GerritUiOptions uiOptions,
|
||||
GerritOptions options,
|
||||
final Injector creatingInjector) {
|
||||
this.authConfig = authConfig;
|
||||
this.urlConfig = urlConfig;
|
||||
this.wantSSL = canonicalUrl != null && canonicalUrl.startsWith("https:");
|
||||
this.uiOptions = uiOptions;
|
||||
this.options = options;
|
||||
|
||||
this.gitWebConfig =
|
||||
creatingInjector.createChildInjector(new AbstractModule() {
|
||||
@ -110,7 +110,7 @@ public class WebModule extends LifecycleModule {
|
||||
throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType());
|
||||
}
|
||||
|
||||
install(new UrlModule(urlConfig, uiOptions));
|
||||
install(new UrlModule(urlConfig, options));
|
||||
install(new UiRpcModule());
|
||||
install(new GerritRequestModule());
|
||||
install(new GitOverHttpServlet.Module());
|
||||
|
@ -20,7 +20,7 @@ import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.gerrit.common.ChangeHookRunner;
|
||||
import com.google.gerrit.httpd.AllRequestFilter;
|
||||
import com.google.gerrit.httpd.GerritUiOptions;
|
||||
import com.google.gerrit.httpd.GerritOptions;
|
||||
import com.google.gerrit.httpd.GitOverHttpModule;
|
||||
import com.google.gerrit.httpd.H2CacheBasedWebSession;
|
||||
import com.google.gerrit.httpd.HttpCanonicalWebUrlProvider;
|
||||
@ -356,7 +356,7 @@ public class Daemon extends SiteProgram {
|
||||
modules.add(new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(GerritUiOptions.class).toInstance(new GerritUiOptions(headless));
|
||||
bind(GerritOptions.class).toInstance(new GerritOptions(headless));
|
||||
if (test) {
|
||||
bind(SecureStore.class).toProvider(SecureStoreProvider.class);
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ public class WebAppInitializer extends GuiceServletContextListener
|
||||
modules.add(new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(GerritUiOptions.class).toInstance(new GerritUiOptions(false));
|
||||
bind(GerritOptions.class).toInstance(new GerritOptions(false));
|
||||
}
|
||||
});
|
||||
modules.add(GarbageCollectionRunner.module());
|
||||
|
Loading…
Reference in New Issue
Block a user