| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) | 295 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) |
| 296 return; | 296 return; |
| 297 if (frame_state_ == FRAME_STATE_LOADED) | 297 if (frame_state_ == FRAME_STATE_LOADED) |
| 298 UpdateState(ErrorScreenActor::ERROR_REASON_UPDATE); | 298 UpdateState(ErrorScreenActor::ERROR_REASON_UPDATE); |
| 299 else if (frame_state_ == FRAME_STATE_ERROR) | 299 else if (frame_state_ == FRAME_STATE_ERROR) |
| 300 UpdateState(ErrorScreenActor::ERROR_REASON_FRAME_ERROR); | 300 UpdateState(ErrorScreenActor::ERROR_REASON_FRAME_ERROR); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void GaiaScreenHandler::HandleCompleteAuthentication( | 303 void GaiaScreenHandler::HandleCompleteAuthentication( |
| 304 const std::string& gaia_id, |
| 304 const std::string& email, | 305 const std::string& email, |
| 305 const std::string& password, | 306 const std::string& password, |
| 306 const std::string& auth_code) { | 307 const std::string& auth_code) { |
| 307 if (!Delegate()) | 308 if (!Delegate()) |
| 308 return; | 309 return; |
| 309 Delegate()->SetDisplayEmail(gaia::SanitizeEmail(email)); | 310 Delegate()->SetDisplayEmail(gaia::SanitizeEmail(email)); |
| 310 UserContext user_context(email); | 311 UserContext user_context(email); |
| 311 user_context.SetKey(Key(password)); | 312 user_context.SetKey(Key(password)); |
| 312 user_context.SetAuthCode(auth_code); | 313 user_context.SetAuthCode(auth_code); |
| 313 Delegate()->CompleteLogin(user_context); | 314 Delegate()->CompleteLogin(user_context); |
| 314 } | 315 } |
| 315 | 316 |
| 316 void GaiaScreenHandler::HandleCompleteLogin(const std::string& typed_email, | 317 void GaiaScreenHandler::HandleCompleteLogin(const std::string& gaia_id, |
| 318 const std::string& typed_email, |
| 317 const std::string& password, | 319 const std::string& password, |
| 318 bool using_saml) { | 320 bool using_saml) { |
| 319 if (!is_enrolling_consumer_management_) { | 321 if (!is_enrolling_consumer_management_) { |
| 320 DoCompleteLogin(typed_email, password, using_saml); | 322 DoCompleteLogin(typed_email, password, using_saml); |
| 321 return; | 323 return; |
| 322 } | 324 } |
| 323 | 325 |
| 324 // Consumer management enrollment is in progress. | 326 // Consumer management enrollment is in progress. |
| 325 const std::string owner_email = | 327 const std::string owner_email = |
| 326 user_manager::UserManager::Get()->GetOwnerEmail(); | 328 user_manager::UserManager::Get()->GetOwnerEmail(); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 | 668 |
| 667 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 669 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 668 DCHECK(signin_screen_handler_); | 670 DCHECK(signin_screen_handler_); |
| 669 return signin_screen_handler_->delegate_; | 671 return signin_screen_handler_->delegate_; |
| 670 } | 672 } |
| 671 | 673 |
| 672 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 674 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 673 signin_screen_handler_ = handler; | 675 signin_screen_handler_ = handler; |
| 674 } | 676 } |
| 675 } // namespace chromeos | 677 } // namespace chromeos |
| OLD | NEW |