| 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/common/system/chromeos/devicetype_utils.h" | 7 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 // GAPS cookie. | 222 // GAPS cookie. |
| 223 std::string gaps_cookie; | 223 std::string gaps_cookie; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 GaiaScreenHandler::GaiaContext::GaiaContext() {} | 226 GaiaScreenHandler::GaiaContext::GaiaContext() {} |
| 227 | 227 |
| 228 GaiaScreenHandler::GaiaScreenHandler( | 228 GaiaScreenHandler::GaiaScreenHandler( |
| 229 CoreOobeView* core_oobe_view, | 229 CoreOobeView* core_oobe_view, |
| 230 const scoped_refptr<NetworkStateInformer>& network_state_informer) | 230 const scoped_refptr<NetworkStateInformer>& network_state_informer) |
| 231 : network_state_informer_(network_state_informer), | 231 : BaseScreenHandler(kScreenId), |
| 232 network_state_informer_(network_state_informer), |
| 232 core_oobe_view_(core_oobe_view), | 233 core_oobe_view_(core_oobe_view), |
| 233 weak_factory_(this) { | 234 weak_factory_(this) { |
| 234 DCHECK(network_state_informer_.get()); | 235 DCHECK(network_state_informer_.get()); |
| 235 set_call_js_prefix(kJsScreenPath); | 236 set_call_js_prefix(kJsScreenPath); |
| 236 } | 237 } |
| 237 | 238 |
| 238 GaiaScreenHandler::~GaiaScreenHandler() { | 239 GaiaScreenHandler::~GaiaScreenHandler() { |
| 239 if (network_portal_detector_) | 240 if (network_portal_detector_) |
| 240 network_portal_detector_->RemoveObserver(this); | 241 network_portal_detector_->RemoveObserver(this); |
| 241 } | 242 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 const NetworkPortalDetector::CaptivePortalState& state) { | 455 const NetworkPortalDetector::CaptivePortalState& state) { |
| 455 VLOG(1) << "OnPortalDetectionCompleted " | 456 VLOG(1) << "OnPortalDetectionCompleted " |
| 456 << NetworkPortalDetector::CaptivePortalStatusString(state.status); | 457 << NetworkPortalDetector::CaptivePortalStatusString(state.status); |
| 457 | 458 |
| 458 const NetworkPortalDetector::CaptivePortalStatus previous_status = | 459 const NetworkPortalDetector::CaptivePortalStatus previous_status = |
| 459 captive_portal_status_; | 460 captive_portal_status_; |
| 460 captive_portal_status_ = state.status; | 461 captive_portal_status_ = state.status; |
| 461 if (offline_login_is_active() || | 462 if (offline_login_is_active() || |
| 462 IsOnline(captive_portal_status_) == IsOnline(previous_status) || | 463 IsOnline(captive_portal_status_) == IsOnline(previous_status) || |
| 463 disable_restrictive_proxy_check_for_test_ || | 464 disable_restrictive_proxy_check_for_test_ || |
| 464 GetCurrentScreen() != OobeScreen::SCREEN_GAIA_SIGNIN) | 465 GetCurrentScreen() != kScreenId) |
| 465 return; | 466 return; |
| 466 | 467 |
| 467 LoadAuthExtension(true /* force */, false /* offline */); | 468 LoadAuthExtension(true /* force */, false /* offline */); |
| 468 } | 469 } |
| 469 | 470 |
| 470 void GaiaScreenHandler::HandleIdentifierEntered(const std::string& user_email) { | 471 void GaiaScreenHandler::HandleIdentifierEntered(const std::string& user_email) { |
| 471 if (!Delegate()->IsUserWhitelisted(user_manager::known_user::GetAccountId( | 472 if (!Delegate()->IsUserWhitelisted(user_manager::known_user::GetAccountId( |
| 472 user_email, std::string() /* id */, AccountType::UNKNOWN))) | 473 user_email, std::string() /* id */, AccountType::UNKNOWN))) |
| 473 ShowWhitelistCheckFailedError(); | 474 ShowWhitelistCheckFailedError(); |
| 474 } | 475 } |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 971 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 971 return signin_screen_handler_->delegate_; | 972 return signin_screen_handler_->delegate_; |
| 972 } | 973 } |
| 973 | 974 |
| 974 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 975 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
| 975 return !disable_restrictive_proxy_check_for_test_ && | 976 return !disable_restrictive_proxy_check_for_test_ && |
| 976 !IsOnline(captive_portal_status_); | 977 !IsOnline(captive_portal_status_); |
| 977 } | 978 } |
| 978 | 979 |
| 979 } // namespace chromeos | 980 } // namespace chromeos |
| OLD | NEW |