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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/about_flags.h" | 25 #include "chrome/browser/about_flags.h" |
26 #include "chrome/browser/app_mode/app_mode_utils.h" | 26 #include "chrome/browser/app_mode/app_mode_utils.h" |
27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 28 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
29 #include "chrome/browser/browser_shutdown.h" | 29 #include "chrome/browser/browser_shutdown.h" |
30 #include "chrome/browser/chrome_notification_types.h" | 30 #include "chrome/browser/chrome_notification_types.h" |
31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 31 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
32 #include "chrome/browser/chromeos/base/locale_util.h" | 32 #include "chrome/browser/chromeos/base/locale_util.h" |
33 #include "chrome/browser/chromeos/boot_times_recorder.h" | 33 #include "chrome/browser/chromeos/boot_times_recorder.h" |
34 #include "chrome/browser/chromeos/first_run/first_run.h" | 34 #include "chrome/browser/chromeos/first_run/first_run.h" |
| 35 #include "chrome/browser/chromeos/first_run/goodies_displayer.h" |
35 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 36 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
36 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" | 37 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h" |
37 #include "chrome/browser/chromeos/login/chrome_restart_request.h" | 38 #include "chrome/browser/chromeos/login/chrome_restart_request.h" |
38 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 39 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
39 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 40 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
40 #include "chrome/browser/chromeos/login/helper.h" | 41 #include "chrome/browser/chromeos/login/helper.h" |
41 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 42 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
42 #include "chrome/browser/chromeos/login/profile_auth_data.h" | 43 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
43 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" | 44 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" |
44 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" | 45 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory
.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 true /* path is absolute */, | 344 true /* path is absolute */, |
344 false /* don't create */); | 345 false /* don't create */); |
345 } | 346 } |
346 } | 347 } |
347 } | 348 } |
348 | 349 |
349 // static | 350 // static |
350 void UserSessionManager::RegisterPrefs(PrefRegistrySimple* registry) { | 351 void UserSessionManager::RegisterPrefs(PrefRegistrySimple* registry) { |
351 registry->RegisterStringPref(prefs::kRLZBrand, std::string()); | 352 registry->RegisterStringPref(prefs::kRLZBrand, std::string()); |
352 registry->RegisterBooleanPref(prefs::kRLZDisabled, false); | 353 registry->RegisterBooleanPref(prefs::kRLZDisabled, false); |
| 354 registry->RegisterBooleanPref(prefs::kCanShowOobeGoodiesPage, true); |
353 } | 355 } |
354 | 356 |
355 UserSessionManager::UserSessionManager() | 357 UserSessionManager::UserSessionManager() |
356 : delegate_(nullptr), | 358 : delegate_(nullptr), |
357 authenticator_(nullptr), | 359 authenticator_(nullptr), |
358 has_auth_cookies_(false), | 360 has_auth_cookies_(false), |
359 user_sessions_restored_(false), | 361 user_sessions_restored_(false), |
360 user_sessions_restore_in_progress_(false), | 362 user_sessions_restore_in_progress_(false), |
361 exit_after_session_restore_(false), | 363 exit_after_session_restore_(false), |
362 session_restore_strategy_( | 364 session_restore_strategy_( |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 profile, base::Bind(&UserSessionManager::OnTokenHandleObtained, | 1132 profile, base::Bind(&UserSessionManager::OnTokenHandleObtained, |
1131 weak_factory_.GetWeakPtr())); | 1133 weak_factory_.GetWeakPtr())); |
1132 } | 1134 } |
1133 } | 1135 } |
1134 } | 1136 } |
1135 | 1137 |
1136 // Now that profile is ready, proceed to either alternative login flows or | 1138 // Now that profile is ready, proceed to either alternative login flows or |
1137 // launch browser. | 1139 // launch browser. |
1138 bool browser_launched = InitializeUserSession(profile); | 1140 bool browser_launched = InitializeUserSession(profile); |
1139 | 1141 |
| 1142 // Check whether to, then set up for, display OOBE Goodies page on first run. |
| 1143 first_run::GoodiesDisplayer::Init(); |
| 1144 |
1140 // TODO(nkostylev): This pointer should probably never be NULL, but it looks | 1145 // TODO(nkostylev): This pointer should probably never be NULL, but it looks |
1141 // like OnProfileCreated() may be getting called before | 1146 // like OnProfileCreated() may be getting called before |
1142 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is | 1147 // UserSessionManager::PrepareProfile() has set |delegate_| when Chrome is |
1143 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace | 1148 // killed during shutdown in tests -- see http://crosbug.com/18269. Replace |
1144 // this 'if' statement with a CHECK(delegate_) once the underlying issue is | 1149 // this 'if' statement with a CHECK(delegate_) once the underlying issue is |
1145 // resolved. | 1150 // resolved. |
1146 if (delegate_) | 1151 if (delegate_) |
1147 delegate_->OnProfilePrepared(profile, browser_launched); | 1152 delegate_->OnProfilePrepared(profile, browser_launched); |
1148 } | 1153 } |
1149 | 1154 |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 token_handle_util_.reset(); | 1761 token_handle_util_.reset(); |
1757 } | 1762 } |
1758 | 1763 |
1759 void UserSessionManager::CreateTokenUtilIfMissing() { | 1764 void UserSessionManager::CreateTokenUtilIfMissing() { |
1760 if (!token_handle_util_.get()) | 1765 if (!token_handle_util_.get()) |
1761 token_handle_util_.reset( | 1766 token_handle_util_.reset( |
1762 new TokenHandleUtil(user_manager::UserManager::Get())); | 1767 new TokenHandleUtil(user_manager::UserManager::Get())); |
1763 } | 1768 } |
1764 | 1769 |
1765 } // namespace chromeos | 1770 } // namespace chromeos |
OLD | NEW |