| 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 return DONT_OFFER; | 652 return DONT_OFFER; |
| 653 | 653 |
| 654 // The checks below depend on chrome already knowing what account the user | 654 // The checks below depend on chrome already knowing what account the user |
| 655 // signed in with. This happens only after receiving the response containing | 655 // signed in with. This happens only after receiving the response containing |
| 656 // the Google-Accounts-SignIn header. Until then, if there is even a chance | 656 // the Google-Accounts-SignIn header. Until then, if there is even a chance |
| 657 // that we want to connect the profile, chrome needs to tell Gaia that | 657 // that we want to connect the profile, chrome needs to tell Gaia that |
| 658 // it should offer the interstitial. Therefore missing one click data on | 658 // it should offer the interstitial. Therefore missing one click data on |
| 659 // the request means can offer is true. | 659 // the request means can offer is true. |
| 660 const std::string& pending_email = io_data->reverse_autologin_pending_email(); | 660 const std::string& pending_email = io_data->reverse_autologin_pending_email(); |
| 661 if (!pending_email.empty()) { | 661 if (!pending_email.empty()) { |
| 662 if (!SigninManager::IsAllowedUsername(pending_email, | 662 if (!SigninManager::IsUsernameAllowedByPolicy(pending_email, |
| 663 io_data->google_services_username_pattern()->GetValue())) { | 663 io_data->google_services_username_pattern()->GetValue())) { |
| 664 return DONT_OFFER; | 664 return DONT_OFFER; |
| 665 } | 665 } |
| 666 | 666 |
| 667 std::vector<std::string> rejected_emails = | 667 std::vector<std::string> rejected_emails = |
| 668 io_data->one_click_signin_rejected_email_list()->GetValue(); | 668 io_data->one_click_signin_rejected_email_list()->GetValue(); |
| 669 if (std::count_if(rejected_emails.begin(), rejected_emails.end(), | 669 if (std::count_if(rejected_emails.begin(), rejected_emails.end(), |
| 670 std::bind2nd(std::equal_to<std::string>(), | 670 std::bind2nd(std::equal_to<std::string>(), |
| 671 pending_email)) > 0) { | 671 pending_email)) > 0) { |
| 672 return DONT_OFFER; | 672 return DONT_OFFER; |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 } | 1279 } |
| 1280 } | 1280 } |
| 1281 ShowSyncConfirmationBubble(display_bubble); | 1281 ShowSyncConfirmationBubble(display_bubble); |
| 1282 signin_tracker_.reset(); | 1282 signin_tracker_.reset(); |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 void OneClickSigninHelper::SigninSuccess() { | 1285 void OneClickSigninHelper::SigninSuccess() { |
| 1286 ShowSyncConfirmationBubble(true); | 1286 ShowSyncConfirmationBubble(true); |
| 1287 signin_tracker_.reset(); | 1287 signin_tracker_.reset(); |
| 1288 } | 1288 } |
| OLD | NEW |