OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/password_manager/core/browser/password_store.h" | 5 #include "components/password_manager/core/browser/password_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 PasswordReuseDetectorConsumer* consumer) { | 325 PasswordReuseDetectorConsumer* consumer) { |
326 auto check_reuse_request = base::MakeUnique<CheckReuseRequest>(consumer); | 326 auto check_reuse_request = base::MakeUnique<CheckReuseRequest>(consumer); |
327 ScheduleTask(base::Bind(&PasswordStore::CheckReuseImpl, this, | 327 ScheduleTask(base::Bind(&PasswordStore::CheckReuseImpl, this, |
328 base::Passed(&check_reuse_request), input, domain)); | 328 base::Passed(&check_reuse_request), input, domain)); |
329 } | 329 } |
330 | 330 |
331 void PasswordStore::SaveSyncPasswordHash(const base::string16& password) { | 331 void PasswordStore::SaveSyncPasswordHash(const base::string16& password) { |
332 ScheduleTask( | 332 ScheduleTask( |
333 base::Bind(&PasswordStore::SaveSyncPasswordHashImpl, this, password)); | 333 base::Bind(&PasswordStore::SaveSyncPasswordHashImpl, this, password)); |
334 } | 334 } |
| 335 |
| 336 void PasswordStore::ClearSyncPasswordHash() { |
| 337 ScheduleTask(base::Bind(&PasswordStore::ClearSyncPasswordHashImpl, this)); |
| 338 } |
335 #endif | 339 #endif |
336 | 340 |
337 PasswordStore::~PasswordStore() { | 341 PasswordStore::~PasswordStore() { |
338 DCHECK(shutdown_called_); | 342 DCHECK(shutdown_called_); |
339 } | 343 } |
340 | 344 |
341 scoped_refptr<base::SingleThreadTaskRunner> | 345 scoped_refptr<base::SingleThreadTaskRunner> |
342 PasswordStore::GetBackgroundTaskRunner() { | 346 PasswordStore::GetBackgroundTaskRunner() { |
343 return db_thread_runner_; | 347 return db_thread_runner_; |
344 } | 348 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 const base::string16& input, | 416 const base::string16& input, |
413 const std::string& domain) { | 417 const std::string& domain) { |
414 if (reuse_detector_) | 418 if (reuse_detector_) |
415 reuse_detector_->CheckReuse(input, domain, request.get()); | 419 reuse_detector_->CheckReuse(input, domain, request.get()); |
416 } | 420 } |
417 | 421 |
418 void PasswordStore::SaveSyncPasswordHashImpl(const base::string16& password) { | 422 void PasswordStore::SaveSyncPasswordHashImpl(const base::string16& password) { |
419 if (reuse_detector_) | 423 if (reuse_detector_) |
420 reuse_detector_->SaveSyncPasswordHash(password); | 424 reuse_detector_->SaveSyncPasswordHash(password); |
421 } | 425 } |
| 426 |
| 427 void PasswordStore::ClearSyncPasswordHashImpl() { |
| 428 if (reuse_detector_) |
| 429 reuse_detector_->ClearSyncPasswordHash(); |
| 430 } |
422 #endif | 431 #endif |
423 | 432 |
424 void PasswordStore::Schedule( | 433 void PasswordStore::Schedule( |
425 void (PasswordStore::*func)(std::unique_ptr<GetLoginsRequest>), | 434 void (PasswordStore::*func)(std::unique_ptr<GetLoginsRequest>), |
426 PasswordStoreConsumer* consumer) { | 435 PasswordStoreConsumer* consumer) { |
427 std::unique_ptr<GetLoginsRequest> request(new GetLoginsRequest(consumer)); | 436 std::unique_ptr<GetLoginsRequest> request(new GetLoginsRequest(consumer)); |
428 consumer->cancelable_task_tracker()->PostTask( | 437 consumer->cancelable_task_tracker()->PostTask( |
429 GetBackgroundTaskRunner().get(), FROM_HERE, | 438 GetBackgroundTaskRunner().get(), FROM_HERE, |
430 base::Bind(func, this, base::Passed(&request))); | 439 base::Bind(func, this, base::Passed(&request))); |
431 } | 440 } |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } | 768 } |
760 | 769 |
761 std::ostream& operator<<(std::ostream& os, | 770 std::ostream& operator<<(std::ostream& os, |
762 const PasswordStore::FormDigest& digest) { | 771 const PasswordStore::FormDigest& digest) { |
763 return os << "FormDigest(scheme: " << digest.scheme | 772 return os << "FormDigest(scheme: " << digest.scheme |
764 << ", signon_realm: " << digest.signon_realm | 773 << ", signon_realm: " << digest.signon_realm |
765 << ", origin: " << digest.origin << ")"; | 774 << ", origin: " << digest.origin << ")"; |
766 } | 775 } |
767 | 776 |
768 } // namespace password_manager | 777 } // namespace password_manager |
OLD | NEW |