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/chrome_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 new ChromeSessionManager(new LoginOobeSessionManagerDelegate())); | 58 new ChromeSessionManager(new LoginOobeSessionManagerDelegate())); |
59 } else if (!base::SysInfo::IsRunningOnChromeOS() && | 59 } else if (!base::SysInfo::IsRunningOnChromeOS() && |
60 login_user_id == login::kStubUser) { | 60 login_user_id == login::kStubUser) { |
61 VLOG(1) << "Starting Chrome with StubLoginSessionManagerDelegate"; | 61 VLOG(1) << "Starting Chrome with StubLoginSessionManagerDelegate"; |
62 return scoped_ptr<session_manager::SessionManager>(new ChromeSessionManager( | 62 return scoped_ptr<session_manager::SessionManager>(new ChromeSessionManager( |
63 new StubLoginSessionManagerDelegate(profile, login_user_id))); | 63 new StubLoginSessionManagerDelegate(profile, login_user_id))); |
64 } else { | 64 } else { |
65 VLOG(1) << "Starting Chrome with RestoreAfterCrashSessionManagerDelegate"; | 65 VLOG(1) << "Starting Chrome with RestoreAfterCrashSessionManagerDelegate"; |
66 // Restarting Chrome inside existing user session. Possible cases: | 66 // Restarting Chrome inside existing user session. Possible cases: |
67 // 1. Chrome is restarted after crash. | 67 // 1. Chrome is restarted after crash. |
68 // 2. Chrome is started in browser_tests skipping the login flow. | 68 // 2. Chrome is restarted for Guest session. |
69 // 3. Chrome is started on dev machine i.e. not on Chrome OS device w/o | 69 // 3. Chrome is started in browser_tests skipping the login flow. |
| 70 // 4. Chrome is started on dev machine i.e. not on Chrome OS device w/o |
70 // login flow. In that case --login-user=[chromeos::login::kStubUser] is | 71 // login flow. In that case --login-user=[chromeos::login::kStubUser] is |
71 // added. See PreEarlyInitialization(). | 72 // added. See PreEarlyInitialization(). |
72 return scoped_ptr<session_manager::SessionManager>(new ChromeSessionManager( | 73 return scoped_ptr<session_manager::SessionManager>(new ChromeSessionManager( |
73 new RestoreAfterCrashSessionManagerDelegate(profile, login_user_id))); | 74 new RestoreAfterCrashSessionManagerDelegate(profile, login_user_id))); |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 ChromeSessionManager::ChromeSessionManager( | 78 ChromeSessionManager::ChromeSessionManager( |
78 session_manager::SessionManagerDelegate* delegate) { | 79 session_manager::SessionManagerDelegate* delegate) { |
79 Initialize(delegate); | 80 Initialize(delegate); |
80 } | 81 } |
81 | 82 |
82 ChromeSessionManager::~ChromeSessionManager() { | 83 ChromeSessionManager::~ChromeSessionManager() { |
83 } | 84 } |
84 | 85 |
85 } // namespace chromeos | 86 } // namespace chromeos |
OLD | NEW |