| 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/ui/webui/options/supervised_user_import_handler.h" | 5 #include "chrome/browser/ui/webui/options/supervised_user_import_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() { | 214 void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() { |
| 215 web_ui()->CallJavascriptFunction( | 215 web_ui()->CallJavascriptFunction( |
| 216 "options.SupervisedUserListData.onSigninError"); | 216 "options.SupervisedUserListData.onSigninError"); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool SupervisedUserImportHandler::IsAccountConnected() const { | 219 bool SupervisedUserImportHandler::IsAccountConnected() const { |
| 220 Profile* profile = Profile::FromWebUI(web_ui()); | 220 Profile* profile = Profile::FromWebUI(web_ui()); |
| 221 SigninManagerBase* signin_manager = | 221 SigninManagerBase* signin_manager = |
| 222 SigninManagerFactory::GetForProfile(profile); | 222 SigninManagerFactory::GetForProfile(profile); |
| 223 return signin_manager && !signin_manager->GetAuthenticatedUsername().empty(); | 223 return signin_manager && signin_manager->IsAuthenticated(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 bool SupervisedUserImportHandler::HasAuthError() const { | 226 bool SupervisedUserImportHandler::HasAuthError() const { |
| 227 Profile* profile = Profile::FromWebUI(web_ui()); | 227 Profile* profile = Profile::FromWebUI(web_ui()); |
| 228 ProfileOAuth2TokenService* token_service = | 228 ProfileOAuth2TokenService* token_service = |
| 229 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 229 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
| 230 if (!token_service) | 230 if (!token_service) |
| 231 return true; | 231 return true; |
| 232 | 232 |
| 233 SigninErrorController* error_controller = | 233 SigninErrorController* error_controller = |
| (...skipping 12 matching lines...) Expand all Loading... |
| 246 const std::string& key) { | 246 const std::string& key) { |
| 247 if (key == supervised_users::kChromeAvatarIndex) | 247 if (key == supervised_users::kChromeAvatarIndex) |
| 248 FetchSupervisedUsers(); | 248 FetchSupervisedUsers(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void SupervisedUserImportHandler::OnErrorChanged() { | 251 void SupervisedUserImportHandler::OnErrorChanged() { |
| 252 FetchSupervisedUsers(); | 252 FetchSupervisedUsers(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace options | 255 } // namespace options |
| OLD | NEW |