| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) | 282 if (network_state_informer_->state() != NetworkStateInformer::ONLINE) |
| 283 return; | 283 return; |
| 284 if (frame_state_ == FRAME_STATE_LOADED) | 284 if (frame_state_ == FRAME_STATE_LOADED) |
| 285 UpdateState(ErrorScreenActor::ERROR_REASON_UPDATE); | 285 UpdateState(ErrorScreenActor::ERROR_REASON_UPDATE); |
| 286 else if (frame_state_ == FRAME_STATE_ERROR) | 286 else if (frame_state_ == FRAME_STATE_ERROR) |
| 287 UpdateState(ErrorScreenActor::ERROR_REASON_FRAME_ERROR); | 287 UpdateState(ErrorScreenActor::ERROR_REASON_FRAME_ERROR); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void GaiaScreenHandler::HandleCompleteAuthentication( | 290 void GaiaScreenHandler::HandleCompleteAuthentication( |
| 291 const std::string& gaia_id, |
| 291 const std::string& email, | 292 const std::string& email, |
| 292 const std::string& password, | 293 const std::string& password, |
| 293 const std::string& auth_code) { | 294 const std::string& auth_code) { |
| 294 if (!Delegate()) | 295 if (!Delegate()) |
| 295 return; | 296 return; |
| 296 Delegate()->SetDisplayEmail(gaia::SanitizeEmail(email)); | 297 Delegate()->SetDisplayEmail(gaia::SanitizeEmail(email)); |
| 297 UserContext user_context(email); | 298 UserContext user_context(email); |
| 298 user_context.SetKey(Key(password)); | 299 user_context.SetKey(Key(password)); |
| 299 user_context.SetAuthCode(auth_code); | 300 user_context.SetAuthCode(auth_code); |
| 300 Delegate()->CompleteLogin(user_context); | 301 Delegate()->CompleteLogin(user_context); |
| 301 } | 302 } |
| 302 | 303 |
| 303 void GaiaScreenHandler::HandleCompleteLogin(const std::string& typed_email, | 304 void GaiaScreenHandler::HandleCompleteLogin(const std::string& gaia_id, |
| 305 const std::string& typed_email, |
| 304 const std::string& password, | 306 const std::string& password, |
| 305 bool using_saml) { | 307 bool using_saml) { |
| 306 if (!is_enrolling_consumer_management_) { | 308 if (!is_enrolling_consumer_management_) { |
| 307 DoCompleteLogin(typed_email, password, using_saml); | 309 DoCompleteLogin(typed_email, password, using_saml); |
| 308 return; | 310 return; |
| 309 } | 311 } |
| 310 | 312 |
| 311 // Consumer management enrollment is in progress. | 313 // Consumer management enrollment is in progress. |
| 312 const std::string owner_email = | 314 const std::string owner_email = |
| 313 user_manager::UserManager::Get()->GetOwnerEmail(); | 315 user_manager::UserManager::Get()->GetOwnerEmail(); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 627 |
| 626 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 628 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 627 DCHECK(signin_screen_handler_); | 629 DCHECK(signin_screen_handler_); |
| 628 return signin_screen_handler_->delegate_; | 630 return signin_screen_handler_->delegate_; |
| 629 } | 631 } |
| 630 | 632 |
| 631 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 633 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 632 signin_screen_handler_ = handler; | 634 signin_screen_handler_ = handler; |
| 633 } | 635 } |
| 634 } // namespace chromeos | 636 } // namespace chromeos |
| OLD | NEW |