diff options
author | rickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 18:51:35 +0000 |
---|---|---|
committer | rickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 18:51:35 +0000 |
commit | c7b7800afbf7aadb5c9f99c95209237cdf869678 (patch) | |
tree | e741fdc86b0da94136eceb3dafc60db63cd930bd /chrome/browser/profile_impl.cc | |
parent | 53fb3cb54e0eff74e74743d0dafd8ca7dd8c5271 (diff) | |
download | chromium_src-c7b7800afbf7aadb5c9f99c95209237cdf869678.zip chromium_src-c7b7800afbf7aadb5c9f99c95209237cdf869678.tar.gz chromium_src-c7b7800afbf7aadb5c9f99c95209237cdf869678.tar.bz2 |
ConvertLabsToSwitches earlier in startup sequence to fix Background Webapps
BUG=58213
TEST=none
If I enable the "Background WebApps" lab and restart, when the BackgroundModeManager checks whether the kEnableBackgroundMode switch is set, CommandLine::HasSwitch returns false because about_labs::ConvertLabsToSwitches has not yet been called.
BrowserMain first calls CreateProfile then later calls about_labs::ConvertLabsToSwitches. However, since CreateProfile initializes the BackgroundModeManager, things break down. Here's the comment preceding the BackgroundModeManager initialization in the ProfileImpl constructor:
// Initialize the BackgroundModeManager - this has to be done here before
// InitExtensions() is called because it relies on receiving notifications
// when extensions are loaded. BackgroundModeManager is not needed under
// ChromeOS because Chrome is always running (no need for special keep-alive
// or launch-on-startup support).
Hence:
* Change about_labs::ConvertLabsToSwitches to accept a PrefService* rather than a Profile*
* Change the ProfileImpl constructor (called by CreateProfile) to call about_labs::ConvertLabsToSwitches immediately after it's call to GetPrefs.
Review URL: http://codereview.chromium.org/3544013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_impl.cc')
-rw-r--r-- | chrome/browser/profile_impl.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc index acbf6f5..b89057d 100644 --- a/chrome/browser/profile_impl.cc +++ b/chrome/browser/profile_impl.cc @@ -43,6 +43,7 @@ #include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/host_zoom_map.h" #include "chrome/browser/in_process_webkit/webkit_context.h" +#include "chrome/browser/labs.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/net/gaia/token_service.h" #include "chrome/browser/net/net_pref_observer.h" @@ -272,6 +273,9 @@ ProfileImpl::ProfileImpl(const FilePath& path) pref_change_registrar_.Add(prefs::kEnableSpellCheck, this); pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); + // Convert active labs into switches. Modifies the current command line. + about_labs::ConvertLabsToSwitches(prefs, CommandLine::ForCurrentProcess()); + #if defined(OS_MACOSX) // If the profile directory doesn't already have a cache directory and it // is under ~/Library/Application Support, use a suitable cache directory |