Index: chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.cc |
diff --git a/chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.cc b/chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8fdd05ddba8bfa3d46ee1822b3ee9070ad6b56da |
--- /dev/null |
+++ b/chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.cc |
@@ -0,0 +1,32 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/chromeos/login/session/stub_login_session_manager_delegate.h" |
+ |
+#include "base/prefs/pref_service.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/pref_names.h" |
+ |
+namespace chromeos { |
+ |
+StubLoginSessionManagerDelegate::StubLoginSessionManagerDelegate( |
+ Profile* profile, |
+ const std::string& login_user_id) |
+ : RestoreAfterCrashSessionManagerDelegate(profile, login_user_id) { |
+} |
+ |
+StubLoginSessionManagerDelegate::~StubLoginSessionManagerDelegate() { |
+} |
+ |
+void StubLoginSessionManagerDelegate::Start() { |
+ session_manager_->SetSessionState(session_manager::SESSION_STATE_ACTIVE); |
+ |
+ // For dev machines and stub user emulate as if sync has been initialized. |
+ profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
+ login_user_id()); |
+ |
+ RestoreAfterCrashSessionManagerDelegate::Start(); |
+} |
+ |
+} // namespace chromeos |