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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return false; | 261 return false; |
262 } | 262 } |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 // If email was already rejected by this profile for one-click sign-in. | 266 // If email was already rejected by this profile for one-click sign-in. |
267 if (!email.empty()) { | 267 if (!email.empty()) { |
268 const ListValue* rejected_emails = profile->GetPrefs()->GetList( | 268 const ListValue* rejected_emails = profile->GetPrefs()->GetList( |
269 prefs::kReverseAutologinRejectedEmailList); | 269 prefs::kReverseAutologinRejectedEmailList); |
270 if (!rejected_emails->empty()) { | 270 if (!rejected_emails->empty()) { |
271 const Value* email_value = Value::CreateStringValue(email); | 271 const scoped_ptr<Value> email_value(Value::CreateStringValue(email)); |
272 ListValue::const_iterator iter = rejected_emails->Find( | 272 ListValue::const_iterator iter = rejected_emails->Find( |
273 *email_value); | 273 *email_value); |
274 if (iter != rejected_emails->end()) | 274 if (iter != rejected_emails->end()) |
275 return false; | 275 return false; |
276 } | 276 } |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 return true; | 280 return true; |
281 } | 281 } |
282 | 282 |
283 // static | 283 // static |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 session_index_ = session_index; | 378 session_index_ = session_index; |
379 email_ = email; | 379 email_ = email; |
380 } | 380 } |
381 | 381 |
382 void OneClickSigninHelper::SavePassword(const std::string& password) { | 382 void OneClickSigninHelper::SavePassword(const std::string& password) { |
383 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of | 383 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of |
384 // challenge, its possible for the user to never complete the signin. | 384 // challenge, its possible for the user to never complete the signin. |
385 // Should have a way to detect this and clear the password member. | 385 // Should have a way to detect this and clear the password member. |
386 password_ = password; | 386 password_ = password; |
387 } | 387 } |
OLD | NEW |