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

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

Issue 2444383008: session_manager: Create ChromeSessionManager early (Closed)
Patch Set: fix compile, StubLoginSessionInitializer -> StubSessionInitializer Created 4 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/session/stub_session_initializer.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/signin_manager_factory.h"
9 #include "chrome/common/pref_names.h"
10 #include "components/prefs/pref_service.h"
11 #include "components/session_manager/core/session_manager.h"
12 #include "components/signin/core/browser/signin_manager.h"
13
14 namespace chromeos {
15
16 StubSessionInitializer::StubSessionInitializer(Profile* profile,
17 const std::string& login_user_id)
18 : RestoreAfterCrashSessionInitializer(profile, login_user_id) {}
19
20 StubSessionInitializer::~StubSessionInitializer() {}
21
22 void StubSessionInitializer::Start() {
23 session_manager::SessionManager::Get()->SetSessionState(
24 session_manager::SessionState::ACTIVE);
25
26 // For dev machines and stub user emulate as if sync has been initialized.
27 SigninManagerFactory::GetForProfile(profile())->SetAuthenticatedAccountInfo(
28 login_user_id(), login_user_id());
29 RestoreAfterCrashSessionInitializer::Start();
30 }
31
32 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698