Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 10805007: [cros] UserManager cleanup regarding stub/demo users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused fields and fix compile Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "chrome/common/pref_names.h" 73 #include "chrome/common/pref_names.h"
74 #include "chromeos/dbus/dbus_thread_manager.h" 74 #include "chromeos/dbus/dbus_thread_manager.h"
75 #include "chromeos/dbus/power_manager_client.h" 75 #include "chromeos/dbus/power_manager_client.h"
76 #include "chromeos/dbus/session_manager_client.h" 76 #include "chromeos/dbus/session_manager_client.h"
77 #include "content/public/browser/notification_service.h" 77 #include "content/public/browser/notification_service.h"
78 #include "content/public/common/main_function_params.h" 78 #include "content/public/common/main_function_params.h"
79 #include "grit/platform_locale_settings.h" 79 #include "grit/platform_locale_settings.h"
80 #include "net/base/network_change_notifier.h" 80 #include "net/base/network_change_notifier.h"
81 #include "net/url_request/url_request.h" 81 #include "net/url_request/url_request.h"
82 82
83 namespace {
84
85 // Username for stub login when not running on ChromeOS.
86 const char kStubUsername[] = "stub-user@example.com";
87
88 }
89
90 class MessageLoopObserver : public MessageLoopForUI::Observer { 83 class MessageLoopObserver : public MessageLoopForUI::Observer {
91 virtual base::EventStatus WillProcessEvent( 84 virtual base::EventStatus WillProcessEvent(
92 const base::NativeEvent& event) OVERRIDE { 85 const base::NativeEvent& event) OVERRIDE {
93 return base::EVENT_CONTINUE; 86 return base::EVENT_CONTINUE;
94 } 87 }
95 88
96 virtual void DidProcessEvent( 89 virtual void DidProcessEvent(
97 const base::NativeEvent& event) OVERRIDE { 90 const base::NativeEvent& event) OVERRIDE {
98 } 91 }
99 }; 92 };
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 browser_defaults::bookmarks_enabled = false; 240 browser_defaults::bookmarks_enabled = false;
248 } 241 }
249 242
250 // If we're not running on real ChromeOS hardware (or under VM), and are not 243 // If we're not running on real ChromeOS hardware (or under VM), and are not
251 // showing the login manager or attempting a command line login, login with a 244 // showing the login manager or attempting a command line login, login with a
252 // stub user. 245 // stub user.
253 if (!base::chromeos::IsRunningOnChromeOS() && 246 if (!base::chromeos::IsRunningOnChromeOS() &&
254 !parsed_command_line().HasSwitch(switches::kLoginManager) && 247 !parsed_command_line().HasSwitch(switches::kLoginManager) &&
255 !parsed_command_line().HasSwitch(switches::kLoginUser) && 248 !parsed_command_line().HasSwitch(switches::kLoginUser) &&
256 !parsed_command_line().HasSwitch(switches::kGuestSession)) { 249 !parsed_command_line().HasSwitch(switches::kGuestSession)) {
257 singleton_command_line->AppendSwitchASCII(switches::kLoginUser, 250 singleton_command_line->AppendSwitchASCII(
258 kStubUsername); 251 switches::kLoginUser, chromeos::UserManager::kStubUser);
259 if (!parsed_command_line().HasSwitch(switches::kLoginProfile)) { 252 if (!parsed_command_line().HasSwitch(switches::kLoginProfile)) {
260 // This must be kept in sync with TestingProfile::kTestUserProfileDir. 253 // This must be kept in sync with TestingProfile::kTestUserProfileDir.
261 singleton_command_line->AppendSwitchASCII( 254 singleton_command_line->AppendSwitchASCII(
262 switches::kLoginProfile, "test-user"); 255 switches::kLoginProfile, "test-user");
263 } 256 }
264 LOG(INFO) << "Running as stub user with profile dir: " 257 LOG(INFO) << "Running as stub user with profile dir: "
265 << singleton_command_line->GetSwitchValuePath( 258 << singleton_command_line->GetSwitchValuePath(
266 switches::kLoginProfile).value(); 259 switches::kLoginProfile).value();
267 } 260 }
268 261
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; 581 LOG(WARNING) << "low_mem: Part of '100MB' experiment";
589 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); 582 chromeos::LowMemoryObserver::SetLowMemoryMargin(100);
590 } else if (trial->group() == margin_200mb) { 583 } else if (trial->group() == margin_200mb) {
591 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; 584 LOG(WARNING) << "low_mem: Part of '200MB' experiment";
592 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); 585 chromeos::LowMemoryObserver::SetLowMemoryMargin(200);
593 } else { 586 } else {
594 LOG(WARNING) << "low_mem: Part of 'default' experiment"; 587 LOG(WARNING) << "low_mem: Part of 'default' experiment";
595 } 588 }
596 } 589 }
597 } 590 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698