| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/net/chrome_url_request_context.h" | 50 #include "chrome/browser/net/chrome_url_request_context.h" |
| 51 #include "chrome/browser/net/preconnect.h" | 51 #include "chrome/browser/net/preconnect.h" |
| 52 #include "chrome/browser/policy/browser_policy_connector.h" | 52 #include "chrome/browser/policy/browser_policy_connector.h" |
| 53 #include "chrome/browser/policy/cloud_policy_client.h" | 53 #include "chrome/browser/policy/cloud_policy_client.h" |
| 54 #include "chrome/browser/policy/cloud_policy_service.h" | 54 #include "chrome/browser/policy/cloud_policy_service.h" |
| 55 #include "chrome/browser/policy/network_configuration_updater.h" | 55 #include "chrome/browser/policy/network_configuration_updater.h" |
| 56 #include "chrome/browser/policy/user_cloud_policy_manager.h" | 56 #include "chrome/browser/policy/user_cloud_policy_manager.h" |
| 57 #include "chrome/browser/prefs/pref_service.h" | 57 #include "chrome/browser/prefs/pref_service.h" |
| 58 #include "chrome/browser/profiles/profile.h" | 58 #include "chrome/browser/profiles/profile.h" |
| 59 #include "chrome/browser/profiles/profile_manager.h" | 59 #include "chrome/browser/profiles/profile_manager.h" |
| 60 #include "chrome/browser/rlz/rlz.h" |
| 60 #include "chrome/browser/signin/signin_manager.h" | 61 #include "chrome/browser/signin/signin_manager.h" |
| 61 #include "chrome/browser/signin/signin_manager_factory.h" | 62 #include "chrome/browser/signin/signin_manager_factory.h" |
| 62 #include "chrome/browser/signin/token_service.h" | 63 #include "chrome/browser/signin/token_service.h" |
| 63 #include "chrome/browser/signin/token_service_factory.h" | 64 #include "chrome/browser/signin/token_service_factory.h" |
| 64 #include "chrome/browser/sync/profile_sync_service.h" | 65 #include "chrome/browser/sync/profile_sync_service.h" |
| 65 #include "chrome/browser/sync/profile_sync_service_factory.h" | 66 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 66 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 67 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 67 #include "chrome/common/chrome_notification_types.h" | 68 #include "chrome/common/chrome_notification_types.h" |
| 68 #include "chrome/common/chrome_paths.h" | 69 #include "chrome/common/chrome_paths.h" |
| 69 #include "chrome/common/chrome_switches.h" | 70 #include "chrome/common/chrome_switches.h" |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 640 |
| 640 user_profile->OnLogin(); | 641 user_profile->OnLogin(); |
| 641 | 642 |
| 642 // Send the notification before creating the browser so additional objects | 643 // Send the notification before creating the browser so additional objects |
| 643 // that need the profile (e.g. the launcher) can be created first. | 644 // that need the profile (e.g. the launcher) can be created first. |
| 644 content::NotificationService::current()->Notify( | 645 content::NotificationService::current()->Notify( |
| 645 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 646 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 646 content::NotificationService::AllSources(), | 647 content::NotificationService::AllSources(), |
| 647 content::Details<Profile>(user_profile)); | 648 content::Details<Profile>(user_profile)); |
| 648 | 649 |
| 650 #if defined(ENABLE_RLZ) |
| 651 // Init the RLZ library. |
| 652 int ping_delay = user_profile->GetPrefs()->GetInteger( |
| 653 first_run::GetPingDelayPrefName().c_str()); |
| 654 RLZTracker::InitRlzFromProfileDelayed( |
| 655 user_profile, UserManager::Get()->IsCurrentUserNew(), ping_delay); |
| 656 #endif |
| 657 |
| 649 // TODO(altimofeev): This pointer should probably never be NULL, but it looks | 658 // TODO(altimofeev): This pointer should probably never be NULL, but it looks |
| 650 // like LoginUtilsImpl::OnProfileCreated() may be getting called before | 659 // like LoginUtilsImpl::OnProfileCreated() may be getting called before |
| 651 // LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed | 660 // LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed |
| 652 // during shutdown in tests -- see http://crosbug.com/18269. Replace this | 661 // during shutdown in tests -- see http://crosbug.com/18269. Replace this |
| 653 // 'if' statement with a CHECK(delegate_) once the underlying issue is | 662 // 'if' statement with a CHECK(delegate_) once the underlying issue is |
| 654 // resolved. | 663 // resolved. |
| 655 if (delegate_) | 664 if (delegate_) |
| 656 delegate_->OnProfilePrepared(user_profile); | 665 delegate_->OnProfilePrepared(user_profile); |
| 657 } | 666 } |
| 658 | 667 |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 bool LoginUtils::IsWhitelisted(const std::string& username) { | 1258 bool LoginUtils::IsWhitelisted(const std::string& username) { |
| 1250 CrosSettings* cros_settings = CrosSettings::Get(); | 1259 CrosSettings* cros_settings = CrosSettings::Get(); |
| 1251 bool allow_new_user = false; | 1260 bool allow_new_user = false; |
| 1252 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1261 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 1253 if (allow_new_user) | 1262 if (allow_new_user) |
| 1254 return true; | 1263 return true; |
| 1255 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 1264 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
| 1256 } | 1265 } |
| 1257 | 1266 |
| 1258 } // namespace chromeos | 1267 } // namespace chromeos |
| OLD | NEW |