| 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 "ash/system/chromeos/devicetype_utils.h" | 7 #include "ash/system/chromeos/devicetype_utils.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 captive_portal_status_ = state.status; | 397 captive_portal_status_ = state.status; |
| 398 if (offline_login_is_active() || | 398 if (offline_login_is_active() || |
| 399 IsOnline(captive_portal_status_) == IsOnline(previous_status) || | 399 IsOnline(captive_portal_status_) == IsOnline(previous_status) || |
| 400 disable_restrictive_proxy_check_for_test_ || | 400 disable_restrictive_proxy_check_for_test_ || |
| 401 GetCurrentScreen() != OobeUI::SCREEN_GAIA_SIGNIN) | 401 GetCurrentScreen() != OobeUI::SCREEN_GAIA_SIGNIN) |
| 402 return; | 402 return; |
| 403 | 403 |
| 404 LoadAuthExtension(true /* force */, false /* offline */); | 404 LoadAuthExtension(true /* force */, false /* offline */); |
| 405 } | 405 } |
| 406 | 406 |
| 407 void GaiaScreenHandler::HandleIdentifierEntered( | 407 void GaiaScreenHandler::HandleIdentifierEntered(const std::string& user_email) { |
| 408 const std::string& account_identifier) { | 408 if (!Delegate()->IsUserWhitelisted( |
| 409 if (!Delegate()->IsUserWhitelisted(account_identifier)) | 409 user_manager::UserManager::Get()->GetKnownUserAccountId( |
| 410 user_email, std::string() /* gaia_id */))) |
| 410 ShowWhitelistCheckFailedError(); | 411 ShowWhitelistCheckFailedError(); |
| 411 } | 412 } |
| 412 | 413 |
| 413 void GaiaScreenHandler::HandleWebviewLoadAborted( | 414 void GaiaScreenHandler::HandleWebviewLoadAborted( |
| 414 const std::string& error_reason_str) { | 415 const std::string& error_reason_str) { |
| 415 // TODO(nkostylev): Switch to int code once webview supports that. | 416 // TODO(nkostylev): Switch to int code once webview supports that. |
| 416 // http://crbug.com/470483 | 417 // http://crbug.com/470483 |
| 417 if (error_reason_str == "ERR_ABORTED") { | 418 if (error_reason_str == "ERR_ABORTED") { |
| 418 LOG(WARNING) << "Ignoring Gaia webview error: " << error_reason_str; | 419 LOG(WARNING) << "Ignoring Gaia webview error: " << error_reason_str; |
| 419 return; | 420 return; |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 878 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 878 return !disable_restrictive_proxy_check_for_test_ && | 879 return !disable_restrictive_proxy_check_for_test_ && |
| 879 !IsOnline(captive_portal_status_); | 880 !IsOnline(captive_portal_status_); |
| 880 } | 881 } |
| 881 | 882 |
| 882 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { | 883 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { |
| 883 disable_restrictive_proxy_check_for_test_ = true; | 884 disable_restrictive_proxy_check_for_test_ = true; |
| 884 } | 885 } |
| 885 | 886 |
| 886 } // namespace chromeos | 887 } // namespace chromeos |
| OLD | NEW |