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