| Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc
|
| diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
|
| index 280082a59af8cca2d8a46687e245be68ddb558fa..f84e8a4f447831481d9810c4d377d0cd61114ce9 100644
|
| --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
|
| +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
|
| @@ -79,6 +79,13 @@
|
| #include "net/base/network_change_notifier.h"
|
| #include "net/url_request/url_request.h"
|
|
|
| +namespace {
|
| +
|
| +// Username for stub login when not running on ChromeOS.
|
| +const char kStubUsername[] = "stub-user@example.com";
|
| +
|
| +}
|
| +
|
| class MessageLoopObserver : public MessageLoopForUI::Observer {
|
| virtual base::EventStatus WillProcessEvent(
|
| const base::NativeEvent& event) OVERRIDE {
|
| @@ -230,14 +237,34 @@ ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() {
|
| // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides ---------
|
|
|
| void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() {
|
| + CommandLine* singleton_command_line = CommandLine::ForCurrentProcess();
|
| +
|
| if (parsed_command_line().HasSwitch(switches::kGuestSession)) {
|
| // Disable sync and extensions if we're in "browse without sign-in" mode.
|
| - CommandLine* singleton_command_line = CommandLine::ForCurrentProcess();
|
| singleton_command_line->AppendSwitch(switches::kDisableSync);
|
| singleton_command_line->AppendSwitch(switches::kDisableExtensions);
|
| browser_defaults::bookmarks_enabled = false;
|
| }
|
|
|
| + // If we're not running on real ChromeOS hardware (or under VM), and are not
|
| + // showing the login manager or attempting a command line login, login with a
|
| + // stub user.
|
| + if (!base::chromeos::IsRunningOnChromeOS() &&
|
| + !parsed_command_line().HasSwitch(switches::kLoginManager) &&
|
| + !parsed_command_line().HasSwitch(switches::kLoginUser) &&
|
| + !parsed_command_line().HasSwitch(switches::kGuestSession)) {
|
| + singleton_command_line->AppendSwitchASCII(switches::kLoginUser,
|
| + kStubUsername);
|
| + if (!parsed_command_line().HasSwitch(switches::kLoginProfile)) {
|
| + // This must be kept in sync with TestingProfile::kTestUserProfileDir.
|
| + singleton_command_line->AppendSwitchASCII(
|
| + switches::kLoginProfile, "test-user");
|
| + }
|
| + LOG(INFO) << "Running as stub user with profile dir: "
|
| + << singleton_command_line->GetSwitchValuePath(
|
| + switches::kLoginProfile).value();
|
| + }
|
| +
|
| ChromeBrowserMainPartsLinux::PreEarlyInitialization();
|
| }
|
|
|
|
|