1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BROWSING_DATA_PASSWORDS_COUNTER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_PASSWORDS_COUNTER_H_
8 #include "chrome/browser/browsing_data/browsing_data_counter.h"
9 #include "components/password_manager/core/browser/password_store.h"
10 #include "components/password_manager/core/browser/password_store_consumer.h"
12 class PasswordsCounter
: public BrowsingDataCounter
,
13 public password_manager::PasswordStoreConsumer
,
14 public password_manager::PasswordStore::Observer
{
17 ~PasswordsCounter() override
;
19 const std::string
& GetPrefName() const override
;
22 const std::string pref_name_
;
23 base::CancelableTaskTracker cancelable_task_tracker_
;
24 password_manager::PasswordStore
* store_
= nullptr;
26 void OnInitialized() override
;
28 // Counting is done asynchronously in a request to PasswordStore.
29 // This callback returns the results, which are subsequently reported.
30 void OnGetPasswordStoreResults(
31 ScopedVector
<autofill::PasswordForm
> results
) override
;
33 // Called when the contents of the password store change. Triggers new
36 const password_manager::PasswordStoreChangeList
& changes
) override
;
38 void Count() override
;
41 #endif // CHROME_BROWSER_BROWSING_DATA_PASSWORDS_COUNTER_H_