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 "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 chrome_browser_net::PreconnectOnUIThread( | 813 chrome_browser_net::PreconnectOnUIThread( |
814 GURL(GaiaUrls::GetInstance()->client_login_url()), | 814 GURL(GaiaUrls::GetInstance()->client_login_url()), |
815 chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED, | 815 chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED, |
816 kConnectionsNeeded, | 816 kConnectionsNeeded, |
817 url_request_context_getter_); | 817 url_request_context_getter_); |
818 csh->RemoveNetworkManagerObserver(this); | 818 csh->RemoveNetworkManagerObserver(this); |
819 delete this; | 819 delete this; |
820 } | 820 } |
821 } | 821 } |
822 | 822 |
| 823 virtual void DefaultNetworkChanged() OVERRIDE { |
| 824 NetworkManagerChanged(); |
| 825 } |
| 826 |
823 // content::NotificationObserver overrides. | 827 // content::NotificationObserver overrides. |
824 virtual void Observe(int type, | 828 virtual void Observe(int type, |
825 const content::NotificationSource& source, | 829 const content::NotificationSource& source, |
826 const content::NotificationDetails& details) OVERRIDE { | 830 const content::NotificationDetails& details) OVERRIDE { |
827 switch (type) { | 831 switch (type) { |
828 case chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED: { | 832 case chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED: { |
829 Profile* profile = content::Source<Profile>(source).ptr(); | 833 Profile* profile = content::Source<Profile>(source).ptr(); |
830 url_request_context_getter_ = profile->GetRequestContext(); | 834 url_request_context_getter_ = profile->GetRequestContext(); |
831 registrar_.Remove( | 835 registrar_.Remove( |
832 this, | 836 this, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 bool LoginUtils::IsWhitelisted(const std::string& username) { | 962 bool LoginUtils::IsWhitelisted(const std::string& username) { |
959 CrosSettings* cros_settings = CrosSettings::Get(); | 963 CrosSettings* cros_settings = CrosSettings::Get(); |
960 bool allow_new_user = false; | 964 bool allow_new_user = false; |
961 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 965 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
962 if (allow_new_user) | 966 if (allow_new_user) |
963 return true; | 967 return true; |
964 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 968 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
965 } | 969 } |
966 | 970 |
967 } // namespace chromeos | 971 } // namespace chromeos |
OLD | NEW |