summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorrickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 18:51:35 +0000
committerrickcam@chromium.org <rickcam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 18:51:35 +0000
commitc7b7800afbf7aadb5c9f99c95209237cdf869678 (patch)
treee741fdc86b0da94136eceb3dafc60db63cd930bd /chrome/browser/browser_main.cc
parent53fb3cb54e0eff74e74743d0dafd8ca7dd8c5271 (diff)
downloadchromium_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/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index d32eda4..85d2c76 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -1202,6 +1202,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
SetBrowserX11ErrorHandlers();
#endif
+ // Modifies the current command line based on active labs.
Profile* profile = CreateProfile(parameters, user_data_dir);
if (!profile)
return ResultCodes::NORMAL_EXIT;
@@ -1211,9 +1212,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
PrefService* user_prefs = profile->GetPrefs();
DCHECK(user_prefs);
- // Convert active labs into switches. Modifies the current command line.
- about_labs::ConvertLabsToSwitches(profile, CommandLine::ForCurrentProcess());
-
// Tests should be able to tune login manager before showing it.
// Thus only show login manager in normal (non-testing) mode.
if (!parameters.ui_task) {