| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/one_click_signin_helper.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 return DONT_OFFER; | 798 return DONT_OFFER; |
| 799 | 799 |
| 800 // The checks below depend on chrome already knowing what account the user | 800 // The checks below depend on chrome already knowing what account the user |
| 801 // signed in with. This happens only after receiving the response containing | 801 // signed in with. This happens only after receiving the response containing |
| 802 // the Google-Accounts-SignIn header. Until then, if there is even a chance | 802 // the Google-Accounts-SignIn header. Until then, if there is even a chance |
| 803 // that we want to connect the profile, chrome needs to tell Gaia that | 803 // that we want to connect the profile, chrome needs to tell Gaia that |
| 804 // it should offer the interstitial. Therefore missing one click data on | 804 // it should offer the interstitial. Therefore missing one click data on |
| 805 // the request means can offer is true. | 805 // the request means can offer is true. |
| 806 const std::string& pending_email = io_data->reverse_autologin_pending_email(); | 806 const std::string& pending_email = io_data->reverse_autologin_pending_email(); |
| 807 if (!pending_email.empty()) { | 807 if (!pending_email.empty()) { |
| 808 if (!SigninManager::IsAllowedUsername(pending_email, | 808 if (!SigninManager::IsUsernameAllowedByPolicy(pending_email, |
| 809 io_data->google_services_username_pattern()->GetValue())) { | 809 io_data->google_services_username_pattern()->GetValue())) { |
| 810 return DONT_OFFER; | 810 return DONT_OFFER; |
| 811 } | 811 } |
| 812 | 812 |
| 813 std::vector<std::string> rejected_emails = | 813 std::vector<std::string> rejected_emails = |
| 814 io_data->one_click_signin_rejected_email_list()->GetValue(); | 814 io_data->one_click_signin_rejected_email_list()->GetValue(); |
| 815 if (std::count_if(rejected_emails.begin(), rejected_emails.end(), | 815 if (std::count_if(rejected_emails.begin(), rejected_emails.end(), |
| 816 std::bind2nd(std::equal_to<std::string>(), | 816 std::bind2nd(std::equal_to<std::string>(), |
| 817 pending_email)) > 0) { | 817 pending_email)) > 0) { |
| 818 return DONT_OFFER; | 818 return DONT_OFFER; |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 | 1441 |
| 1442 void OneClickSigninHelper::SigninSuccess() { | 1442 void OneClickSigninHelper::SigninSuccess() { |
| 1443 RedirectOnSigninComplete(true); | 1443 RedirectOnSigninComplete(true); |
| 1444 } | 1444 } |
| 1445 | 1445 |
| 1446 void OneClickSigninHelper::RedirectOnSigninComplete(bool show_bubble) { | 1446 void OneClickSigninHelper::RedirectOnSigninComplete(bool show_bubble) { |
| 1447 // Show the result in the sign-in bubble if desired. | 1447 // Show the result in the sign-in bubble if desired. |
| 1448 RedirectToNtpOrAppsPage(show_bubble); | 1448 RedirectToNtpOrAppsPage(show_bubble); |
| 1449 signin_tracker_.reset(); | 1449 signin_tracker_.reset(); |
| 1450 } | 1450 } |
| OLD | NEW |