| 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 27 matching lines...) Expand all Loading... |
| 38 #include "url/gurl.h" | 38 #include "url/gurl.h" |
| 39 | 39 |
| 40 | 40 |
| 41 SigninSupervisedUserImportHandler::SigninSupervisedUserImportHandler() | 41 SigninSupervisedUserImportHandler::SigninSupervisedUserImportHandler() |
| 42 : weak_ptr_factory_(this) { | 42 : weak_ptr_factory_(this) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 SigninSupervisedUserImportHandler::~SigninSupervisedUserImportHandler() { | 45 SigninSupervisedUserImportHandler::~SigninSupervisedUserImportHandler() { |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SigninSupervisedUserImportHandler::GetLocalizedValues( |
| 49 base::DictionaryValue* localized_strings) { |
| 50 DCHECK(localized_strings); |
| 51 |
| 52 localized_strings->SetString("supervisedUserImportTitle", |
| 53 l10n_util::GetStringUTF16( |
| 54 IDS_IMPORT_EXISTING_LEGACY_SUPERVISED_USER_TITLE)); |
| 55 localized_strings->SetString("supervisedUserImportText", |
| 56 l10n_util::GetStringUTF16( |
| 57 IDS_IMPORT_EXISTING_LEGACY_SUPERVISED_USER_TEXT)); |
| 58 localized_strings->SetString("noSupervisedUserImportText", |
| 59 l10n_util::GetStringUTF16(IDS_IMPORT_NO_EXISTING_SUPERVISED_USER_TEXT)); |
| 60 localized_strings->SetString("supervisedUserImportOk", |
| 61 l10n_util::GetStringUTF16(IDS_IMPORT_EXISTING_LEGACY_SUPERVISED_USER_OK)); |
| 62 localized_strings->SetString("supervisedUserAlreadyOnThisDevice", |
| 63 l10n_util::GetStringUTF16( |
| 64 IDS_LEGACY_SUPERVISED_USER_ALREADY_ON_THIS_DEVICE)); |
| 65 } |
| 66 |
| 48 void SigninSupervisedUserImportHandler::RegisterMessages() { | 67 void SigninSupervisedUserImportHandler::RegisterMessages() { |
| 49 web_ui()->RegisterMessageCallback("getExistingSupervisedUsers", | 68 web_ui()->RegisterMessageCallback("getExistingSupervisedUsers", |
| 50 base::Bind(&SigninSupervisedUserImportHandler::GetExistingSupervisedUsers, | 69 base::Bind(&SigninSupervisedUserImportHandler::GetExistingSupervisedUsers, |
| 51 base::Unretained(this))); | 70 base::Unretained(this))); |
| 52 web_ui()->RegisterMessageCallback("openUrlInLastActiveProfileBrowser", | 71 web_ui()->RegisterMessageCallback("openUrlInLastActiveProfileBrowser", |
| 53 base::Bind( | 72 base::Bind( |
| 54 &SigninSupervisedUserImportHandler::OpenUrlInLastActiveProfileBrowser, | 73 &SigninSupervisedUserImportHandler::OpenUrlInLastActiveProfileBrowser, |
| 55 base::Unretained(this))); | 74 base::Unretained(this))); |
| 56 } | 75 } |
| 57 | 76 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 264 |
| 246 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { | 265 bool SigninSupervisedUserImportHandler::HasAuthError(Profile* profile) const { |
| 247 SigninErrorController* error_controller = | 266 SigninErrorController* error_controller = |
| 248 SigninErrorControllerFactory::GetForProfile(profile); | 267 SigninErrorControllerFactory::GetForProfile(profile); |
| 249 if (!error_controller) | 268 if (!error_controller) |
| 250 return true; | 269 return true; |
| 251 | 270 |
| 252 GoogleServiceAuthError::State state = error_controller->auth_error().state(); | 271 GoogleServiceAuthError::State state = error_controller->auth_error().state(); |
| 253 return state != GoogleServiceAuthError::NONE; | 272 return state != GoogleServiceAuthError::NONE; |
| 254 } | 273 } |
| OLD | NEW |