| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/signin/signin_supervised_user_import_handler.h
" | 5 #include "chrome/browser/ui/webui/signin/signin_supervised_user_import_handler.h
" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 RejectCallback(GetLocalErorrMessage()); | 113 RejectCallback(GetLocalErorrMessage()); |
| 114 break; | 114 break; |
| 115 } | 115 } |
| 116 case Profile::CREATE_STATUS_CREATED: { | 116 case Profile::CREATE_STATUS_CREATED: { |
| 117 // Ignore the intermediate status. | 117 // Ignore the intermediate status. |
| 118 break; | 118 break; |
| 119 } | 119 } |
| 120 case Profile::CREATE_STATUS_INITIALIZED: { | 120 case Profile::CREATE_STATUS_INITIALIZED: { |
| 121 // We are only interested in Profile::CREATE_STATUS_INITIALIZED when | 121 // We are only interested in Profile::CREATE_STATUS_INITIALIZED when |
| 122 // everything is ready. | 122 // everything is ready. |
| 123 if (profile->IsSupervised()) | 123 if (profile->IsSupervised()) { |
| 124 webui_callback_id_.clear(); |
| 124 return; | 125 return; |
| 126 } |
| 125 | 127 |
| 126 if (!IsAccountConnected(profile) || HasAuthError(profile)) { | 128 if (!IsAccountConnected(profile) || HasAuthError(profile)) { |
| 127 RejectCallback(GetAuthErorrMessage()); | 129 RejectCallback(GetAuthErorrMessage()); |
| 128 return; | 130 return; |
| 129 } | 131 } |
| 130 | 132 |
| 131 SupervisedUserSyncService* supervised_user_sync_service = | 133 SupervisedUserSyncService* supervised_user_sync_service = |
| 132 SupervisedUserSyncServiceFactory::GetForProfile(profile); | 134 SupervisedUserSyncServiceFactory::GetForProfile(profile); |
| 133 if (supervised_user_sync_service) { | 135 if (supervised_user_sync_service) { |
| 134 supervised_user_sync_service->GetSupervisedUsersAsync( | 136 supervised_user_sync_service->GetSupervisedUsersAsync( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 245 |
| 244 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { | 246 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { |
| 245 SigninErrorController* error_controller = | 247 SigninErrorController* error_controller = |
| 246 SigninErrorControllerFactory::GetForProfile(profile); | 248 SigninErrorControllerFactory::GetForProfile(profile); |
| 247 if (!error_controller) | 249 if (!error_controller) |
| 248 return true; | 250 return true; |
| 249 | 251 |
| 250 GoogleServiceAuthError::State state = error_controller->auth_error().state(); | 252 GoogleServiceAuthError::State state = error_controller->auth_error().state(); |
| 251 return state != GoogleServiceAuthError::NONE; | 253 return state != GoogleServiceAuthError::NONE; |
| 252 } | 254 } |
| OLD | NEW |