OLD | NEW |
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/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "components/signin/core/browser/signin_manager.h" |
10 | 12 |
11 namespace chromeos { | 13 namespace chromeos { |
12 | 14 |
13 StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate( | 15 StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate( |
14 Profile* profile, | 16 Profile* profile, |
15 const std::string& login_user_id) | 17 const std::string& login_user_id) |
16 : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) { | 18 : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) { |
17 } | 19 } |
18 | 20 |
19 StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() { | 21 StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() { |
20 } | 22 } |
21 | 23 |
22 void StubLoginSessionManagerDelegate::Start() { | 24 void StubLoginSessionManagerDelegate::Start() { |
23 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); | 25 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); |
24 | 26 |
25 // For dev machines and stub user emulate as if sync has been initialized. | 27 // For dev machines and stub user emulate as if sync has been initialized. |
26 profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 28 SigninManagerFactory::GetForProfile(profile()) |
27 login_user_id()); | 29 ->SetAuthenticatedUsername(login_user_id()); |
28 | |
29 RestoreAfterCrashSessionManagerDelegate::Start(); | 30 RestoreAfterCrashSessionManagerDelegate::Start(); |
30 } | 31 } |
31 | 32 |
32 } // namespace chromeos | 33 } // namespace chromeos |
OLD | NEW |