| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 return false; | 426 return false; |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 // If email was already rejected by this profile for one-click sign-in. | 431 // If email was already rejected by this profile for one-click sign-in. |
| 432 if (!email.empty()) { | 432 if (!email.empty()) { |
| 433 const ListValue* rejected_emails = profile->GetPrefs()->GetList( | 433 const ListValue* rejected_emails = profile->GetPrefs()->GetList( |
| 434 prefs::kReverseAutologinRejectedEmailList); | 434 prefs::kReverseAutologinRejectedEmailList); |
| 435 if (!rejected_emails->empty()) { | 435 if (!rejected_emails->empty()) { |
| 436 const scoped_ptr<Value> email_value(new base::StringValue(email)); | |
| 437 base::ListValue::const_iterator iter = rejected_emails->Find( | 436 base::ListValue::const_iterator iter = rejected_emails->Find( |
| 438 *email_value); | 437 base::StringValue(email)); |
| 439 if (iter != rejected_emails->end()) | 438 if (iter != rejected_emails->end()) |
| 440 return false; | 439 return false; |
| 441 } | 440 } |
| 442 } | 441 } |
| 443 | 442 |
| 444 // If we're about to show a one-click infobar but the user has started | 443 // If we're about to show a one-click infobar but the user has started |
| 445 // a concurrent signin flow (perhaps via the promo), we may not have yet | 444 // a concurrent signin flow (perhaps via the promo), we may not have yet |
| 446 // established an authenticated username but we still shouldn't move | 445 // established an authenticated username but we still shouldn't move |
| 447 // forward with two simultaneous signin processes. This is a bit | 446 // forward with two simultaneous signin processes. This is a bit |
| 448 // contentious as the one-click flow is a much smoother flow from the user | 447 // contentious as the one-click flow is a much smoother flow from the user |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 std::string()); | 777 std::string()); |
| 779 } | 778 } |
| 780 | 779 |
| 781 void OneClickSigninHelper::SigninFailed(const GoogleServiceAuthError& error) { | 780 void OneClickSigninHelper::SigninFailed(const GoogleServiceAuthError& error) { |
| 782 signin_tracker_.reset(); | 781 signin_tracker_.reset(); |
| 783 } | 782 } |
| 784 | 783 |
| 785 void OneClickSigninHelper::SigninSuccess() { | 784 void OneClickSigninHelper::SigninSuccess() { |
| 786 signin_tracker_.reset(); | 785 signin_tracker_.reset(); |
| 787 } | 786 } |
| OLD | NEW |