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

Side by Side Diff: chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/login/session/stub_login_session_manager_deleg ate.h" 5 #include "chrome/browser/chromeos/login/session/stub_login_session_manager_deleg ate.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "components/signin/core/browser/signin_manager.h" 11 #include "components/signin/core/browser/signin_manager.h"
12 #include "components/user_manager/user_id.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 15
15 StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate( 16 StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate(
16 Profile* profile, 17 Profile* profile,
17 const std::string& login_user_id) 18 const user_manager::UserID& login_user_id)
18 : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) { 19 : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) {
19 } 20 }
20 21
21 StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() { 22 StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() {
22 } 23 }
23 24
24 void StubLoginSessionManagerDelegate::Start() { 25 void StubLoginSessionManagerDelegate::Start() {
25 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); 26 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE);
26 27
27 // For dev machines and stub user emulate as if sync has been initialized. 28 // For dev machines and stub user emulate as if sync has been initialized.
28 SigninManagerFactory::GetForProfile(profile()) 29 SigninManagerFactory::GetForProfile(profile())
29 ->SetAuthenticatedAccountInfo(login_user_id(), login_user_id()); 30 ->SetAuthenticatedAccountInfo(login_user_id().GetGaiaId(), login_user_id() .GetUserEmail());
30 RestoreAfterCrashSessionManagerDelegate::Start(); 31 RestoreAfterCrashSessionManagerDelegate::Start();
31 } 32 }
32 33
33 } // namespace chromeos 34 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698