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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 public net::NetworkChangeNotifier::ConnectionTypeObserver, | 114 public net::NetworkChangeNotifier::ConnectionTypeObserver, |
115 public content::NotificationObserver, | 115 public content::NotificationObserver, |
116 public base::SupportsWeakPtr<LoginUtilsImpl> { | 116 public base::SupportsWeakPtr<LoginUtilsImpl> { |
117 public: | 117 public: |
118 LoginUtilsImpl() | 118 LoginUtilsImpl() |
119 : using_oauth_(false), | 119 : using_oauth_(false), |
120 has_web_auth_cookies_(false), | 120 has_web_auth_cookies_(false), |
121 login_manager_(OAuthLoginManager::Create(this)), | 121 login_manager_(OAuthLoginManager::Create(this)), |
122 delegate_(NULL), | 122 delegate_(NULL), |
123 should_restore_auth_session_(false), | 123 should_restore_auth_session_(false), |
| 124 session_restore_strategy_( |
| 125 OAuthLoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN), |
124 url_request_context_getter_(NULL) { | 126 url_request_context_getter_(NULL) { |
125 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 127 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
126 // During tests, the browser_process may not be initialized yet causing | 128 // During tests, the browser_process may not be initialized yet causing |
127 // this to fail. | 129 // this to fail. |
128 if (g_browser_process) { | 130 if (g_browser_process) { |
129 registrar_.Add( | 131 registrar_.Add( |
130 this, | 132 this, |
131 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, | 133 chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED, |
132 content::Source<Profile>(ProfileManager::GetDefaultProfile())); | 134 content::Source<Profile>(ProfileManager::GetDefaultProfile())); |
133 } | 135 } |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 bool LoginUtils::IsWhitelisted(const std::string& username) { | 946 bool LoginUtils::IsWhitelisted(const std::string& username) { |
945 CrosSettings* cros_settings = CrosSettings::Get(); | 947 CrosSettings* cros_settings = CrosSettings::Get(); |
946 bool allow_new_user = false; | 948 bool allow_new_user = false; |
947 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 949 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
948 if (allow_new_user) | 950 if (allow_new_user) |
949 return true; | 951 return true; |
950 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 952 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
951 } | 953 } |
952 | 954 |
953 } // namespace chromeos | 955 } // namespace chromeos |
OLD | NEW |