Make Chrome built for Chrome OS works on Linux with --stub-cros

This functionality was recently broken by this cl: http://codereview.chromium.org/7029019

BUG=none
TEST=build Chrome of Chrome OS and run it on Linux with --stub-cros, no crash should observed

Review URL: http://codereview.chromium.org/6990003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86579 0039d316-1c4b-4281-b951-d872f2087c98
parent 2e10cc29
......@@ -1203,6 +1203,14 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Must happen before we try to use a message loop or display any UI.
InitializeToolkit(parameters);
#if defined(OS_CHROMEOS)
// Stub out chromeos implementations. We need to do as early as possible
// because it is initialized on first use when it is initialized
// SetUseStubImpl doesn't do anything.
if (parameters.command_line_.HasSwitch(switches::kStubCros))
chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl();
#endif
parts->MainMessageLoopStart();
// WARNING: If we get a WM_ENDSESSION, objects created on the stack here
......@@ -1532,10 +1540,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
// Profile creation ----------------------------------------------------------
#if defined(OS_CHROMEOS)
// Stub out chromeos implementations.
if (parsed_command_line.HasSwitch(switches::kStubCros))
chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl();
// Initialize the screen locker now so that it can receive
// LOGIN_USER_CHANGED notification from UserManager.
chromeos::ScreenLocker::InitClass();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment