| 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/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 // TODO(nkostylev): This pointer should probably never be NULL, but it looks | 1184 // TODO(nkostylev): This pointer should probably never be NULL, but it looks |
| 1185 // like OnProfileCreated() may be getting called before | 1185 // like OnProfileCreated() may be getting called before |
| 1186 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is | 1186 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is |
| 1187 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace | 1187 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace |
| 1188 // this 'if' statement with a CHECK(delegate_) once the underlying issue is | 1188 // this 'if' statement with a CHECK(delegate_) once the underlying issue is |
| 1189 // resolved. | 1189 // resolved. |
| 1190 if (delegate_) | 1190 if (delegate_) |
| 1191 delegate_->OnProfilePrepared(profile, browser_launched); | 1191 delegate_->OnProfilePrepared(profile, browser_launched); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 void UserSessionManager::ActivateWizard(const std::string& screen_name) { | 1194 void UserSessionManager::ActivateWizard(OobeScreen screen) { |
| 1195 LoginDisplayHost* host = LoginDisplayHost::default_host(); | 1195 LoginDisplayHost* host = LoginDisplayHost::default_host(); |
| 1196 CHECK(host); | 1196 CHECK(host); |
| 1197 host->StartWizard(screen_name); | 1197 host->StartWizard(screen); |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 void UserSessionManager::InitializeStartUrls() const { | 1200 void UserSessionManager::InitializeStartUrls() const { |
| 1201 // Child account status should be known by the time of this call. | 1201 // Child account status should be known by the time of this call. |
| 1202 std::vector<std::string> start_urls; | 1202 std::vector<std::string> start_urls; |
| 1203 | 1203 |
| 1204 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 1204 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 1205 | 1205 |
| 1206 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() == | 1206 bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() == |
| 1207 user_manager::USER_TYPE_REGULAR; | 1207 user_manager::USER_TYPE_REGULAR; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 InitializeStartUrls(); | 1266 InitializeStartUrls(); |
| 1267 else | 1267 else |
| 1268 waiting_for_child_account_status_ = true; | 1268 waiting_for_child_account_status_ = true; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 // Mark the device as registered., i.e. the second part of OOBE as | 1271 // Mark the device as registered., i.e. the second part of OOBE as |
| 1272 // completed. | 1272 // completed. |
| 1273 if (!StartupUtils::IsDeviceRegistered()) | 1273 if (!StartupUtils::IsDeviceRegistered()) |
| 1274 StartupUtils::MarkDeviceRegistered(base::Closure()); | 1274 StartupUtils::MarkDeviceRegistered(base::Closure()); |
| 1275 | 1275 |
| 1276 ActivateWizard(WizardController::kTermsOfServiceScreenName); | 1276 ActivateWizard(OobeScreen::SCREEN_TERMS_OF_SERVICE); |
| 1277 return false; | 1277 return false; |
| 1278 } | 1278 } |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 DoBrowserLaunch(profile, LoginDisplayHost::default_host()); | 1281 DoBrowserLaunch(profile, LoginDisplayHost::default_host()); |
| 1282 return true; | 1282 return true; |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 void UserSessionManager::InitSessionRestoreStrategy() { | 1285 void UserSessionManager::InitSessionRestoreStrategy() { |
| 1286 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 1286 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 ->browser_policy_connector_chromeos() | 1847 ->browser_policy_connector_chromeos() |
| 1848 ->IsEnterpriseManaged()) { | 1848 ->IsEnterpriseManaged()) { |
| 1849 return false; | 1849 return false; |
| 1850 } | 1850 } |
| 1851 | 1851 |
| 1852 // Do not show end of life notification if this is a guest session | 1852 // Do not show end of life notification if this is a guest session |
| 1853 return !profile->IsGuestSession(); | 1853 return !profile->IsGuestSession(); |
| 1854 } | 1854 } |
| 1855 | 1855 |
| 1856 } // namespace chromeos | 1856 } // namespace chromeos |
| OLD | NEW |