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:
Simon Lei 2014-09-09 14:09:22 -04:00 committed by Hugo Arès
parent f54fc13ac7
commit 6b60160dda
5 changed files with 13 additions and 13 deletions

View File

@ -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;
}

View File

@ -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());

View File

@ -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());

View File

@ -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);
}

View File

@ -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());