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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 const std::string& gaps_cookie) { | 434 const std::string& gaps_cookie) { |
435 if (!Delegate()) | 435 if (!Delegate()) |
436 return; | 436 return; |
437 | 437 |
438 DCHECK(!email.empty()); | 438 DCHECK(!email.empty()); |
439 DCHECK(!gaia_id.empty()); | 439 DCHECK(!gaia_id.empty()); |
440 const std::string sanitized_email = gaia::SanitizeEmail(email); | 440 const std::string sanitized_email = gaia::SanitizeEmail(email); |
441 Delegate()->SetDisplayEmail(sanitized_email); | 441 Delegate()->SetDisplayEmail(sanitized_email); |
442 | 442 |
443 UserContext user_context(GetAccountId(email, gaia_id)); | 443 UserContext user_context(GetAccountId(email, gaia_id)); |
444 user_context.SetGaiaID(gaia_id); | |
445 user_context.SetKey(Key(password)); | 444 user_context.SetKey(Key(password)); |
446 user_context.SetAuthCode(auth_code); | 445 user_context.SetAuthCode(auth_code); |
447 user_context.SetAuthFlow(using_saml | 446 user_context.SetAuthFlow(using_saml |
448 ? UserContext::AUTH_FLOW_GAIA_WITH_SAML | 447 ? UserContext::AUTH_FLOW_GAIA_WITH_SAML |
449 : UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); | 448 : UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); |
450 user_context.SetGAPSCookie(gaps_cookie); | 449 user_context.SetGAPSCookie(gaps_cookie); |
451 Delegate()->CompleteLogin(user_context); | 450 Delegate()->CompleteLogin(user_context); |
452 } | 451 } |
453 | 452 |
454 void GaiaScreenHandler::HandleCompleteAuthenticationAuthCodeOnly( | 453 void GaiaScreenHandler::HandleCompleteAuthenticationAuthCodeOnly( |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 return; | 517 return; |
519 | 518 |
520 if (using_saml && !using_saml_api_) | 519 if (using_saml && !using_saml_api_) |
521 RecordSAMLScrapingVerificationResultInHistogram(true); | 520 RecordSAMLScrapingVerificationResultInHistogram(true); |
522 | 521 |
523 DCHECK(!typed_email.empty()); | 522 DCHECK(!typed_email.empty()); |
524 DCHECK(!gaia_id.empty()); | 523 DCHECK(!gaia_id.empty()); |
525 const std::string sanitized_email = gaia::SanitizeEmail(typed_email); | 524 const std::string sanitized_email = gaia::SanitizeEmail(typed_email); |
526 Delegate()->SetDisplayEmail(sanitized_email); | 525 Delegate()->SetDisplayEmail(sanitized_email); |
527 UserContext user_context(GetAccountId(typed_email, gaia_id)); | 526 UserContext user_context(GetAccountId(typed_email, gaia_id)); |
528 user_context.SetGaiaID(gaia_id); | |
529 user_context.SetKey(Key(password)); | 527 user_context.SetKey(Key(password)); |
530 user_context.SetAuthFlow(using_saml | 528 user_context.SetAuthFlow(using_saml |
531 ? UserContext::AUTH_FLOW_GAIA_WITH_SAML | 529 ? UserContext::AUTH_FLOW_GAIA_WITH_SAML |
532 : UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); | 530 : UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); |
533 Delegate()->CompleteLogin(user_context); | 531 Delegate()->CompleteLogin(user_context); |
534 | 532 |
535 if (test_expects_complete_login_) { | 533 if (test_expects_complete_login_) { |
536 VLOG(2) << "Complete test login for " << typed_email | 534 VLOG(2) << "Complete test login for " << typed_email |
537 << ", requested=" << test_user_; | 535 << ", requested=" << test_user_; |
538 | 536 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 bool GaiaScreenHandler::IsRestrictiveProxy() const { | 790 bool GaiaScreenHandler::IsRestrictiveProxy() const { |
793 return !disable_restrictive_proxy_check_for_test_ && | 791 return !disable_restrictive_proxy_check_for_test_ && |
794 !IsOnline(captive_portal_status_); | 792 !IsOnline(captive_portal_status_); |
795 } | 793 } |
796 | 794 |
797 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { | 795 void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() { |
798 disable_restrictive_proxy_check_for_test_ = true; | 796 disable_restrictive_proxy_check_for_test_ = true; |
799 } | 797 } |
800 | 798 |
801 } // namespace chromeos | 799 } // namespace chromeos |
OLD | NEW |