Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / session / stub_login_session_manager_delegate.cc
blobb9f408383ed15bc1ee57435d7fe5e6142766e767
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.
5 #include "chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.h"
7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/common/pref_names.h"
11 #include "components/signin/core/browser/signin_manager.h"
13 namespace chromeos {
15 StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate(
16 Profile* profile,
17 const std::string& login_user_id)
18 : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) {
21 StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() {
24 void StubLoginSessionManagerDelegate::Start() {
25 session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE);
27 // For dev machines and stub user emulate as if sync has been initialized.
28 SigninManagerFactory::GetForProfile(profile())
29 ->SetAuthenticatedAccountInfo(login_user_id(), login_user_id());
30 RestoreAfterCrashSessionManagerDelegate::Start();
33 } // namespace chromeos