OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/login/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 builder->Add("createAccount", IDS_CREATE_ACCOUNT_HTML); | 317 builder->Add("createAccount", IDS_CREATE_ACCOUNT_HTML); |
318 builder->Add("guestSignin", IDS_BROWSE_WITHOUT_SIGNING_IN_HTML); | 318 builder->Add("guestSignin", IDS_BROWSE_WITHOUT_SIGNING_IN_HTML); |
319 builder->Add("createSupervisedUser", | 319 builder->Add("createSupervisedUser", |
320 IDS_CREATE_SUPERVISED_USER_HTML); | 320 IDS_CREATE_SUPERVISED_USER_HTML); |
321 builder->Add("createSupervisedUserFeatureName", | 321 builder->Add("createSupervisedUserFeatureName", |
322 IDS_CREATE_SUPERVISED_USER_FEATURE_NAME); | 322 IDS_CREATE_SUPERVISED_USER_FEATURE_NAME); |
323 builder->Add("consumerManagementEnrollmentSigninMessage", | 323 builder->Add("consumerManagementEnrollmentSigninMessage", |
324 IDS_LOGIN_CONSUMER_MANAGEMENT_ENROLLMENT); | 324 IDS_LOGIN_CONSUMER_MANAGEMENT_ENROLLMENT); |
325 builder->Add("backButton", IDS_ACCNAME_BACK); | 325 builder->Add("backButton", IDS_ACCNAME_BACK); |
326 builder->Add("closeButton", IDS_CLOSE); | 326 builder->Add("closeButton", IDS_CLOSE); |
| 327 builder->Add("whitelistErrorConsumer", IDS_LOGIN_ERROR_WHITELIST); |
| 328 builder->Add("whitelistErrorEnterprise", |
| 329 IDS_ENTERPRISE_LOGIN_ERROR_WHITELIST); |
| 330 builder->Add("tryAgainButton", IDS_WHITELIST_ERROR_TRY_AGAIN_BUTTON); |
| 331 builder->Add("learnMoreButton", IDS_WHITELIST_ERROR_LEARN_MORE_BUTTON); |
327 | 332 |
328 // Strings used by the SAML fatal error dialog. | 333 // Strings used by the SAML fatal error dialog. |
329 builder->Add("fatalErrorMessageNoAccountDetails", | 334 builder->Add("fatalErrorMessageNoAccountDetails", |
330 IDS_LOGIN_FATAL_ERROR_NO_ACCOUNT_DETAILS); | 335 IDS_LOGIN_FATAL_ERROR_NO_ACCOUNT_DETAILS); |
331 builder->Add("fatalErrorMessageNoPassword", | 336 builder->Add("fatalErrorMessageNoPassword", |
332 IDS_LOGIN_FATAL_ERROR_NO_PASSWORD); | 337 IDS_LOGIN_FATAL_ERROR_NO_PASSWORD); |
333 builder->Add("fatalErrorMessageVerificationFailed", | 338 builder->Add("fatalErrorMessageVerificationFailed", |
334 IDS_LOGIN_FATAL_ERROR_PASSWORD_VERIFICATION); | 339 IDS_LOGIN_FATAL_ERROR_PASSWORD_VERIFICATION); |
335 builder->Add("fatalErrorMessageInsecureURL", | 340 builder->Add("fatalErrorMessageInsecureURL", |
336 IDS_LOGIN_FATAL_ERROR_TEXT_INSECURE_URL); | 341 IDS_LOGIN_FATAL_ERROR_TEXT_INSECURE_URL); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 !gaia_silent_load_ && | 818 !gaia_silent_load_ && |
814 !cookies_cleared_ && | 819 !cookies_cleared_ && |
815 !dns_clear_task_running_ && | 820 !dns_clear_task_running_ && |
816 network_state_informer_->state() == NetworkStateInformer::ONLINE) { | 821 network_state_informer_->state() == NetworkStateInformer::ONLINE) { |
817 gaia_silent_load_ = true; | 822 gaia_silent_load_ = true; |
818 gaia_silent_load_network_ = network_state_informer_->network_path(); | 823 gaia_silent_load_network_ = network_state_informer_->network_path(); |
819 LoadAuthExtension(true, true, false); | 824 LoadAuthExtension(true, true, false); |
820 } | 825 } |
821 } | 826 } |
822 | 827 |
| 828 void GaiaScreenHandler::ShowWhitelistCheckFailedError() { |
| 829 base::DictionaryValue params; |
| 830 params.SetBoolean("enterpriseManaged", |
| 831 g_browser_process->platform_part() |
| 832 ->browser_policy_connector_chromeos() |
| 833 ->IsEnterpriseManaged()); |
| 834 CallJS("showWhitelistCheckFailedError", true, params); |
| 835 } |
| 836 |
823 void GaiaScreenHandler::LoadAuthExtension(bool force, | 837 void GaiaScreenHandler::LoadAuthExtension(bool force, |
824 bool silent_load, | 838 bool silent_load, |
825 bool offline) { | 839 bool offline) { |
826 GaiaContext context; | 840 GaiaContext context; |
827 context.force_reload = force; | 841 context.force_reload = force; |
828 context.is_local = offline; | 842 context.is_local = offline; |
829 context.password_changed = !populated_email_.empty() && | 843 context.password_changed = !populated_email_.empty() && |
830 password_changed_for_.count(populated_email_); | 844 password_changed_for_.count(populated_email_); |
831 context.use_offline = offline; | 845 context.use_offline = offline; |
832 context.email = populated_email_; | 846 context.email = populated_email_; |
(...skipping 21 matching lines...) Expand all Loading... |
854 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 868 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
855 DCHECK(signin_screen_handler_); | 869 DCHECK(signin_screen_handler_); |
856 return signin_screen_handler_->delegate_; | 870 return signin_screen_handler_->delegate_; |
857 } | 871 } |
858 | 872 |
859 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 873 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
860 signin_screen_handler_ = handler; | 874 signin_screen_handler_ = handler; |
861 } | 875 } |
862 | 876 |
863 } // namespace chromeos | 877 } // namespace chromeos |
OLD | NEW |