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 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // may be reported. | 201 // may be reported. |
202 virtual void ReportMetrics(const std::string& sync_username, | 202 virtual void ReportMetrics(const std::string& sync_username, |
203 bool custom_passphrase_sync_enabled); | 203 bool custom_passphrase_sync_enabled); |
204 | 204 |
205 // Adds or replaces the statistics for the domain |stats.origin_domain|. | 205 // Adds or replaces the statistics for the domain |stats.origin_domain|. |
206 void AddSiteStats(const InteractionsStats& stats); | 206 void AddSiteStats(const InteractionsStats& stats); |
207 | 207 |
208 // Removes the statistics for |origin_domain|. | 208 // Removes the statistics for |origin_domain|. |
209 void RemoveSiteStats(const GURL& origin_domain); | 209 void RemoveSiteStats(const GURL& origin_domain); |
210 | 210 |
| 211 // Retrieves the statistics for all sites and notifies |consumer| on |
| 212 // completion. The request will be cancelled if the consumer is destroyed. |
| 213 void GetAllSiteStats(PasswordStoreConsumer* consumer); |
| 214 |
211 // Retrieves the statistics for |origin_domain| and notifies |consumer| on | 215 // Retrieves the statistics for |origin_domain| and notifies |consumer| on |
212 // completion. The request will be cancelled if the consumer is destroyed. | 216 // completion. The request will be cancelled if the consumer is destroyed. |
213 void GetSiteStats(const GURL& origin_domain, PasswordStoreConsumer* consumer); | 217 void GetSiteStats(const GURL& origin_domain, PasswordStoreConsumer* consumer); |
214 | 218 |
215 // Adds an observer to be notified when the password store data changes. | 219 // Adds an observer to be notified when the password store data changes. |
216 void AddObserver(Observer* observer); | 220 void AddObserver(Observer* observer); |
217 | 221 |
218 // Removes |observer| from the observer list. | 222 // Removes |observer| from the observer list. |
219 void RemoveObserver(Observer* observer); | 223 void RemoveObserver(Observer* observer); |
220 | 224 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const autofill::PasswordForm& form) = 0; | 355 const autofill::PasswordForm& form) = 0; |
352 | 356 |
353 // Finds and returns all PasswordForms with the same signon_realm as |form|, | 357 // Finds and returns all PasswordForms with the same signon_realm as |form|, |
354 // or with a signon_realm that is a PSL-match to that of |form|. | 358 // or with a signon_realm that is a PSL-match to that of |form|. |
355 virtual std::vector<std::unique_ptr<autofill::PasswordForm>> | 359 virtual std::vector<std::unique_ptr<autofill::PasswordForm>> |
356 FillMatchingLogins(const FormDigest& form) = 0; | 360 FillMatchingLogins(const FormDigest& form) = 0; |
357 | 361 |
358 // Synchronous implementation for manipulating with statistics. | 362 // Synchronous implementation for manipulating with statistics. |
359 virtual void AddSiteStatsImpl(const InteractionsStats& stats) = 0; | 363 virtual void AddSiteStatsImpl(const InteractionsStats& stats) = 0; |
360 virtual void RemoveSiteStatsImpl(const GURL& origin_domain) = 0; | 364 virtual void RemoveSiteStatsImpl(const GURL& origin_domain) = 0; |
| 365 virtual std::vector<InteractionsStats> GetAllSiteStatsImpl() = 0; |
361 virtual std::vector<InteractionsStats> GetSiteStatsImpl( | 366 virtual std::vector<InteractionsStats> GetSiteStatsImpl( |
362 const GURL& origin_domain) = 0; | 367 const GURL& origin_domain) = 0; |
363 | 368 |
364 // Log UMA stats for number of bulk deletions. | 369 // Log UMA stats for number of bulk deletions. |
365 void LogStatsForBulkDeletion(int num_deletions); | 370 void LogStatsForBulkDeletion(int num_deletions); |
366 | 371 |
367 // Log UMA stats for password deletions happening on clear browsing data | 372 // Log UMA stats for password deletions happening on clear browsing data |
368 // since first sync during rollback. | 373 // since first sync during rollback. |
369 void LogStatsForBulkDeletionDuringRollback(int num_deletions); | 374 void LogStatsForBulkDeletionDuringRollback(int num_deletions); |
370 | 375 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 std::unique_ptr<GetLoginsRequest> request); | 452 std::unique_ptr<GetLoginsRequest> request); |
448 | 453 |
449 // Finds all blacklist PasswordForms, and notifies the consumer. | 454 // Finds all blacklist PasswordForms, and notifies the consumer. |
450 void GetBlacklistLoginsImpl(std::unique_ptr<GetLoginsRequest> request); | 455 void GetBlacklistLoginsImpl(std::unique_ptr<GetLoginsRequest> request); |
451 | 456 |
452 // Same as above, but also fills in |affiliated_web_realm| for Android | 457 // Same as above, but also fills in |affiliated_web_realm| for Android |
453 // credentials. | 458 // credentials. |
454 void GetBlacklistLoginsWithAffiliatedRealmsImpl( | 459 void GetBlacklistLoginsWithAffiliatedRealmsImpl( |
455 std::unique_ptr<GetLoginsRequest> request); | 460 std::unique_ptr<GetLoginsRequest> request); |
456 | 461 |
| 462 // Notifies |request| about the stats for all sites. |
| 463 void NotifyAllSiteStats(std::unique_ptr<GetLoginsRequest> request); |
| 464 |
457 // Notifies |request| about the stats for |origin_domain|. | 465 // Notifies |request| about the stats for |origin_domain|. |
458 void NotifySiteStats(const GURL& origin_domain, | 466 void NotifySiteStats(const GURL& origin_domain, |
459 std::unique_ptr<GetLoginsRequest> request); | 467 std::unique_ptr<GetLoginsRequest> request); |
460 | 468 |
461 // Notifies |request| about the autofillable logins with affiliated web | 469 // Notifies |request| about the autofillable logins with affiliated web |
462 // realms for Android credentials. | 470 // realms for Android credentials. |
463 void NotifyLoginsWithAffiliatedRealms( | 471 void NotifyLoginsWithAffiliatedRealms( |
464 std::unique_ptr<GetLoginsRequest> request, | 472 std::unique_ptr<GetLoginsRequest> request, |
465 std::vector<std::unique_ptr<autofill::PasswordForm>> obtained_forms); | 473 std::vector<std::unique_ptr<autofill::PasswordForm>> obtained_forms); |
466 | 474 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 DISALLOW_COPY_AND_ASSIGN(PasswordStore); | 549 DISALLOW_COPY_AND_ASSIGN(PasswordStore); |
542 }; | 550 }; |
543 | 551 |
544 // For logging only. | 552 // For logging only. |
545 std::ostream& operator<<(std::ostream& os, | 553 std::ostream& operator<<(std::ostream& os, |
546 const PasswordStore::FormDigest& digest); | 554 const PasswordStore::FormDigest& digest); |
547 | 555 |
548 } // namespace password_manager | 556 } // namespace password_manager |
549 | 557 |
550 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 558 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
OLD | NEW |