| 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/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 // positive. This happens when the user types one email address in the | 635 // positive. This happens when the user types one email address in the |
| 636 // gaia sign in page, but signs in to a different account in the SAML sign in | 636 // gaia sign in page, but signs in to a different account in the SAML sign in |
| 637 // page. | 637 // page. |
| 638 std::string default_email; | 638 std::string default_email; |
| 639 std::string validate_email; | 639 std::string validate_email; |
| 640 if (net::GetValueForKeyInQuery(current_url, "email", &default_email) && | 640 if (net::GetValueForKeyInQuery(current_url, "email", &default_email) && |
| 641 net::GetValueForKeyInQuery(current_url, "validateEmail", | 641 net::GetValueForKeyInQuery(current_url, "validateEmail", |
| 642 &validate_email) && | 642 &validate_email) && |
| 643 validate_email == "1") { | 643 validate_email == "1") { |
| 644 if (!gaia::AreEmailsSame(email, default_email)) { | 644 if (!gaia::AreEmailsSame(email, default_email)) { |
| 645 SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE); | 645 HandleLoginError( |
| 646 l10n_util::GetStringFUTF8(IDS_SYNC_WRONG_EMAIL, |
| 647 base::UTF8ToUTF16(default_email))); |
| 646 return; | 648 return; |
| 647 } | 649 } |
| 648 } | 650 } |
| 649 | 651 |
| 650 base::string16 session_index_string16; | 652 base::string16 session_index_string16; |
| 651 dict->GetString("sessionIndex", &session_index_string16); | 653 dict->GetString("sessionIndex", &session_index_string16); |
| 652 std::string session_index = base::UTF16ToASCII(session_index_string16); | 654 std::string session_index = base::UTF16ToASCII(session_index_string16); |
| 653 DCHECK(!session_index.empty()); | 655 DCHECK(!session_index.empty()); |
| 654 | 656 |
| 655 bool choose_what_to_sync = false; | 657 bool choose_what_to_sync = false; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 } | 774 } |
| 773 } | 775 } |
| 774 | 776 |
| 775 if (show_account_management) { | 777 if (show_account_management) { |
| 776 browser->window()->ShowAvatarBubbleFromAvatarButton( | 778 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 777 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 779 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
| 778 signin::ManageAccountsParams()); | 780 signin::ManageAccountsParams()); |
| 779 } | 781 } |
| 780 } | 782 } |
| 781 } | 783 } |
| OLD | NEW |