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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 290123004: Canonicalize user ID passed via chromeos::switches::kLoginUser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ExtensionNetworkingPrivateApiTestInstantiation tests. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/screenlock_private_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2d2519706b2b3f5bd97a83926f22f2983b2d3e37..a72b44deeec813a4cfac3347eae1f8101f363a92 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -44,6 +44,7 @@
#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/login/auth/authenticator.h"
+#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/login_wizard.h"
@@ -168,9 +169,9 @@ class StubLogin : public LoginStatusConsumer,
// LoginUtils::Delegate implementation:
virtual void OnProfilePrepared(Profile* profile) OVERRIDE {
- const std::string login_user =
+ const std::string login_user = login::CanonicalizeUserID(
CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- chromeos::switches::kLoginUser);
+ switches::kLoginUser));
if (!policy::IsDeviceLocalAccountUser(login_user, NULL)) {
profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
login_user);
@@ -356,7 +357,7 @@ void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() {
browser_defaults::bookmarks_enabled = false;
}
- // If we're not running on real ChromeOS hardware (or under VM), and are not
+ // If we're not running on real Chrome OS hardware (or under VM), and are not
// showing the login manager or attempting a command line login, login with a
// stub user.
if (!base::SysInfo::IsRunningOnChromeOS() &&
@@ -523,8 +524,8 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() {
ChromeBrowserMainPartsLinux::PreProfileInit();
if (immediate_login) {
- const std::string user_id =
- parsed_command_line().GetSwitchValueASCII(switches::kLoginUser);
+ const std::string user_id = login::CanonicalizeUserID(
+ parsed_command_line().GetSwitchValueASCII(switches::kLoginUser));
UserManager* user_manager = UserManager::Get();
if (policy::IsDeviceLocalAccountUser(user_id, NULL) &&
@@ -616,8 +617,9 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
// i.e. not on Chrome OS device w/o login flow.
if (parsed_command_line().HasSwitch(switches::kLoginUser) &&
!parsed_command_line().HasSwitch(switches::kLoginPassword)) {
- std::string login_user = parsed_command_line().GetSwitchValueASCII(
- chromeos::switches::kLoginUser);
+ std::string login_user = login::CanonicalizeUserID(
+ parsed_command_line().GetSwitchValueASCII(
+ chromeos::switches::kLoginUser));
if (!base::SysInfo::IsRunningOnChromeOS() &&
login_user == UserManager::kStubUser) {
// For dev machines and stub user emulate as if sync has been initialized.
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/screenlock_private_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698