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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 void PasswordStore::AddSiteStats(const InteractionsStats& stats) { | 259 void PasswordStore::AddSiteStats(const InteractionsStats& stats) { |
260 ScheduleTask(base::Bind(&PasswordStore::AddSiteStatsImpl, this, stats)); | 260 ScheduleTask(base::Bind(&PasswordStore::AddSiteStatsImpl, this, stats)); |
261 } | 261 } |
262 | 262 |
263 void PasswordStore::RemoveSiteStats(const GURL& origin_domain) { | 263 void PasswordStore::RemoveSiteStats(const GURL& origin_domain) { |
264 ScheduleTask( | 264 ScheduleTask( |
265 base::Bind(&PasswordStore::RemoveSiteStatsImpl, this, origin_domain)); | 265 base::Bind(&PasswordStore::RemoveSiteStatsImpl, this, origin_domain)); |
266 } | 266 } |
267 | 267 |
| 268 void PasswordStore::GetAllSiteStats(PasswordStoreConsumer* consumer) { |
| 269 std::unique_ptr<GetLoginsRequest> request(new GetLoginsRequest(consumer)); |
| 270 ScheduleTask(base::Bind(&PasswordStore::NotifyAllSiteStats, this, |
| 271 base::Passed(&request))); |
| 272 } |
| 273 |
268 void PasswordStore::GetSiteStats(const GURL& origin_domain, | 274 void PasswordStore::GetSiteStats(const GURL& origin_domain, |
269 PasswordStoreConsumer* consumer) { | 275 PasswordStoreConsumer* consumer) { |
270 std::unique_ptr<GetLoginsRequest> request(new GetLoginsRequest(consumer)); | 276 std::unique_ptr<GetLoginsRequest> request(new GetLoginsRequest(consumer)); |
271 ScheduleTask(base::Bind(&PasswordStore::NotifySiteStats, this, origin_domain, | 277 ScheduleTask(base::Bind(&PasswordStore::NotifySiteStats, this, origin_domain, |
272 base::Passed(&request))); | 278 base::Passed(&request))); |
273 } | 279 } |
274 | 280 |
275 void PasswordStore::AddObserver(Observer* observer) { | 281 void PasswordStore::AddObserver(Observer* observer) { |
276 observers_->AddObserver(observer); | 282 observers_->AddObserver(observer); |
277 } | 283 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 if (!FillBlacklistLogins(&obtained_forms)) | 519 if (!FillBlacklistLogins(&obtained_forms)) |
514 obtained_forms.clear(); | 520 obtained_forms.clear(); |
515 // Since AffiliatedMatchHelper's requests should be sent from UI thread, | 521 // Since AffiliatedMatchHelper's requests should be sent from UI thread, |
516 // post a request to UI thread. | 522 // post a request to UI thread. |
517 main_thread_runner_->PostTask( | 523 main_thread_runner_->PostTask( |
518 FROM_HERE, | 524 FROM_HERE, |
519 base::Bind(&PasswordStore::InjectAffiliatedWebRealms, this, | 525 base::Bind(&PasswordStore::InjectAffiliatedWebRealms, this, |
520 base::Passed(&obtained_forms), base::Passed(&request))); | 526 base::Passed(&obtained_forms), base::Passed(&request))); |
521 } | 527 } |
522 | 528 |
| 529 void PasswordStore::NotifyAllSiteStats( |
| 530 std::unique_ptr<GetLoginsRequest> request) { |
| 531 request->NotifyWithSiteStatistics(GetAllSiteStatsImpl()); |
| 532 } |
| 533 |
523 void PasswordStore::NotifySiteStats(const GURL& origin_domain, | 534 void PasswordStore::NotifySiteStats(const GURL& origin_domain, |
524 std::unique_ptr<GetLoginsRequest> request) { | 535 std::unique_ptr<GetLoginsRequest> request) { |
525 request->NotifyWithSiteStatistics(GetSiteStatsImpl(origin_domain)); | 536 request->NotifyWithSiteStatistics(GetSiteStatsImpl(origin_domain)); |
526 } | 537 } |
527 | 538 |
528 void PasswordStore::GetLoginsWithAffiliationsImpl( | 539 void PasswordStore::GetLoginsWithAffiliationsImpl( |
529 const FormDigest& form, | 540 const FormDigest& form, |
530 std::unique_ptr<GetLoginsRequest> request, | 541 std::unique_ptr<GetLoginsRequest> request, |
531 const std::vector<std::string>& additional_android_realms) { | 542 const std::vector<std::string>& additional_android_realms) { |
532 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); | 543 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 720 } |
710 | 721 |
711 std::ostream& operator<<(std::ostream& os, | 722 std::ostream& operator<<(std::ostream& os, |
712 const PasswordStore::FormDigest& digest) { | 723 const PasswordStore::FormDigest& digest) { |
713 return os << "FormDigest(scheme: " << digest.scheme | 724 return os << "FormDigest(scheme: " << digest.scheme |
714 << ", signon_realm: " << digest.signon_realm | 725 << ", signon_realm: " << digest.signon_realm |
715 << ", origin: " << digest.origin << ")"; | 726 << ", origin: " << digest.origin << ")"; |
716 } | 727 } |
717 | 728 |
718 } // namespace password_manager | 729 } // namespace password_manager |
OLD | NEW |