diff options
-rw-r--r-- | chrome/browser/background_mode_manager.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/options/advanced_contents_gtk.cc | 15 | ||||
-rw-r--r-- | chrome/browser/views/options/advanced_contents_view.cc | 9 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 8 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 |
5 files changed, 25 insertions, 15 deletions
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc index b619177..4fe5e2e 100644 --- a/chrome/browser/background_mode_manager.cc +++ b/chrome/browser/background_mode_manager.cc @@ -36,10 +36,10 @@ BackgroundModeManager::BackgroundModeManager(Profile* profile) background_app_count_(0), status_tray_(NULL), status_icon_(NULL) { - // If background mode is disabled for unittests, just exit - don't listen for + // If background mode is globally disabled, just exit - don't listen for // any notifications. - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableBackgroundMode)) + if (!CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBackgroundMode)) return; // If the -keep-alive-for-test flag is passed, then always keep chrome running diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 97afbc9..67369a9 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -14,6 +14,7 @@ #include "app/gtk_util.h" #include "app/l10n_util.h" #include "base/basictypes.h" +#include "base/command_line.h" #include "base/environment.h" #include "base/file_util.h" #include "base/path_service.h" @@ -39,6 +40,7 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/process_watcher.h" #include "grit/chromium_strings.h" @@ -1362,10 +1364,13 @@ void AdvancedContentsGtk::Init() { l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY), security_section_->get_page_widget(), false); - chrome_apps_section_.reset(new ChromeAppsSection(profile_)); - options_builder->AddOptionGroup( - l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CHROME_APPS), - chrome_apps_section_->get_page_widget(), false); - + // Add ChromeApps preferences if background mode is runtime-enabled. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBackgroundMode)) { + chrome_apps_section_.reset(new ChromeAppsSection(profile_)); + options_builder->AddOptionGroup(l10n_util::GetStringUTF8( + IDS_OPTIONS_ADVANCED_SECTION_TITLE_CHROME_APPS), + chrome_apps_section_->get_page_widget(), false); + } page_ = options_builder->get_page_widget(); } diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 4a8123b..665ec53 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -14,6 +14,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" +#include "base/command_line.h" #include "base/file_util.h" #include "base/i18n/rtl.h" #include "base/message_loop.h" @@ -40,6 +41,7 @@ #include "chrome/browser/views/options/content_settings_window_view.h" #include "chrome/browser/views/options/fonts_languages_window_view.h" #include "chrome/browser/views/restart_message_box.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "gfx/canvas_skia.h" #include "gfx/native_theme_win.h" @@ -1458,8 +1460,11 @@ void AdvancedContentsView::InitControlLayout() { layout->AddView(new WebContentSection(profile())); layout->StartRow(0, single_column_view_set_id); layout->AddView(new SecuritySection(profile())); - layout->StartRow(0, single_column_view_set_id); - layout->AddView(new ChromeAppsSection(profile())); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBackgroundMode)) { + layout->StartRow(0, single_column_view_set_id); + layout->AddView(new ChromeAppsSection(profile())); + } } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 8c21012..c232c8d 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -140,10 +140,6 @@ const char kDisableAudio[] = "disable-audio"; const char kDisableAuthNegotiateCnameLookup[] = "disable-auth-negotiate-cname-lookup"; -// Disable background mode (background apps will not keep chrome running in the -// background) - used when running tests involving background apps. -const char kDisableBackgroundMode[] = "disable-background-mode"; - // Disable limits on the number of backing stores. Can prevent blinking for // users with many windows/tabs and lots of memory. const char kDisableBackingStoreLimit[] = "disable-backing-store-limit"; @@ -350,6 +346,10 @@ const char kEnableAeroPeekTabs[] = "enable-aero-peek-tabs"; // for more background. const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port"; +// Enable background mode (background apps will keep chrome running in the +// background and allow chrome to launch on startup). +const char kEnableBackgroundMode[] = "enable-background-mode"; + // Enables the benchmarking extensions. const char kEnableBenchmarking[] = "enable-benchmarking"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 409f09d..1c9f8ef 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -52,7 +52,6 @@ extern const char kDisableApplicationCache[]; extern const char kDisableApps[]; extern const char kDisableAudio[]; extern const char kDisableAuthNegotiateCnameLookup[]; -extern const char kDisableBackgroundMode[]; extern const char kDisableBackingStoreLimit[]; extern const char kDisableByteRangeSupport[]; extern const char kDisableConnectBackupJobs[]; @@ -111,6 +110,7 @@ extern const char kEnableAcceleratedCompositing[]; extern const char kEnableAccelerated2dCanvas[]; extern const char kEnableAeroPeekTabs[]; extern const char kEnableAuthNegotiatePort[]; +extern const char kEnableBackgroundMode[]; extern const char kEnableBenchmarking[]; extern const char kEnableRemoting[]; extern const char kEnableClickToPlay[]; |