Chromium Code Reviews| Index: components/password_manager/core/browser/password_store.h |
| diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h |
| index 74ff469f51d9c978af08b50f22be4882832baa7a..3f5b2dc04096edbedb7ba95be61affc002e54190 100644 |
| --- a/components/password_manager/core/browser/password_store.h |
| +++ b/components/password_manager/core/browser/password_store.h |
| @@ -30,6 +30,7 @@ namespace password_manager { |
| class AffiliatedMatchHelper; |
| class PasswordStoreConsumer; |
| class PasswordSyncableService; |
| +struct InteractionsStats; |
| // Interface for storing form passwords in a platform-specific secure way. |
| // The login request/manipulation API is not threadsafe and must be used |
| @@ -128,6 +129,16 @@ class PasswordStore : protected PasswordStoreSync, |
| virtual void ReportMetrics(const std::string& sync_username, |
| bool custom_passphrase_sync_enabled); |
| + // Adds or replaces the statistics for the domain |stats.origin_domain|. |
| + void AddSiteStats(const InteractionsStats& stats); |
| + |
| + // Removes the statistics for |origin_domain|. |
| + void RemoveSiteStats(const GURL& origin_domain); |
| + |
| + // Retrieves the statistics for |origin_domain| and notifies |consumer| on |
| + // completion. The request will be cancelled if the consumer is destroyed. |
| + void GetSiteStats(const GURL& origin_domain, PasswordStoreConsumer* consumer); |
| + |
| // Adds an observer to be notified when the password store data changes. |
| void AddObserver(Observer* observer); |
| @@ -162,6 +173,8 @@ class PasswordStore : protected PasswordStoreSync, |
| void NotifyConsumerWithResults( |
| ScopedVector<autofill::PasswordForm> results); |
| + void NotifyWithSiteStatistics(scoped_ptr<InteractionsStats> stats); |
| + |
| void set_ignore_logins_cutoff(base::Time cutoff) { |
| ignore_logins_cutoff_ = cutoff; |
| } |
| @@ -235,6 +248,13 @@ class PasswordStore : protected PasswordStoreSync, |
| // Finds all blacklist PasswordForms, and notifies the consumer. |
| virtual void GetBlacklistLoginsImpl(scoped_ptr<GetLoginsRequest> request) = 0; |
| + // Synchromous implementation for manipulating with statistics. |
|
vabr (Chromium)
2015/04/24 17:36:53
typo: Synchronous
vasilii
2015/04/24 18:40:47
Done.
|
| + virtual void AddSiteStatsImpl(const InteractionsStats& stats) = 0; |
| + virtual void RemoveSiteStatsImpl(const GURL& origin_domain) = 0; |
| + // Returns a raw pointer so that InteractionsStats can be forward declared. |
|
vabr (Chromium)
2015/04/24 17:36:52
Does using scoped_ptr really require #including th
vasilii
2015/04/24 18:40:48
Done.
|
| + virtual InteractionsStats* GetSiteStatsImpl(const GURL& origin_domain) |
| + WARN_UNUSED_RESULT = 0; |
| + |
| // Log UMA stats for number of bulk deletions. |
| void LogStatsForBulkDeletion(int num_deletions); |
| @@ -287,6 +307,8 @@ class PasswordStore : protected PasswordStoreSync, |
| base::Time delete_end); |
| void RemoveLoginsSyncedBetweenInternal(base::Time delete_begin, |
| base::Time delete_end); |
| + void GetSiteStatsInternal(const GURL& origin_domain, |
|
vabr (Chromium)
2015/04/24 17:36:52
nit: Usually, methods called Get* return something
vabr (Chromium)
2015/04/24 17:36:53
Also, there are now 3 methods with the GetSiteStat
vasilii
2015/04/24 18:40:48
Done.
vasilii
2015/04/24 18:40:48
Done.
|
| + scoped_ptr<GetLoginsRequest> request); |
| // Extended version of GetLoginsImpl that also returns credentials stored for |
| // the specified affiliated Android applications. That is, it finds all |