OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ | 5 #ifndef COMPONENTS_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ |
6 #define COMPONENTS_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ | 6 #define COMPONENTS_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "components/browsing_data/core/counters/browsing_data_counter.h" | 11 #include "components/browsing_data/core/counters/browsing_data_counter.h" |
12 #include "components/password_manager/core/browser/password_store.h" | 12 #include "components/password_manager/core/browser/password_store.h" |
13 #include "components/password_manager/core/browser/password_store_consumer.h" | 13 #include "components/password_manager/core/browser/password_store_consumer.h" |
14 #include "components/sync/driver/sync_service_observer.h" | 14 #include "components/sync/driver/sync_service_observer.h" |
15 | 15 |
16 namespace browsing_data { | 16 namespace browsing_data { |
17 | 17 |
18 class PasswordsCounter : public browsing_data::BrowsingDataCounter, | 18 class PasswordsCounter : public browsing_data::BrowsingDataCounter, |
19 public password_manager::PasswordStoreConsumer, | 19 public password_manager::PasswordStoreConsumer, |
20 public password_manager::PasswordStore::Observer, | 20 public password_manager::PasswordStore::Observer, |
21 public syncer::SyncServiceObserver { | 21 public syncer::SyncServiceObserver { |
22 public: | 22 public: |
23 class PasswordResult : public FinishedResult { | |
24 public: | |
25 PasswordResult(const PasswordsCounter* source, | |
26 ResultInt value, | |
27 bool password_sync_enabled); | |
28 ~PasswordResult() override; | |
29 | |
30 bool password_sync_enabled() const { return password_sync_enabled_; } | |
31 | |
32 private: | |
33 bool password_sync_enabled_; | |
34 }; | |
35 | |
36 explicit PasswordsCounter( | 23 explicit PasswordsCounter( |
37 scoped_refptr<password_manager::PasswordStore> store, | 24 scoped_refptr<password_manager::PasswordStore> store, |
38 syncer::SyncService* sync_service); | 25 syncer::SyncService* sync_service); |
39 ~PasswordsCounter() override; | 26 ~PasswordsCounter() override; |
40 | 27 |
41 const char* GetPrefName() const override; | 28 const char* GetPrefName() const override; |
42 | 29 |
43 private: | 30 private: |
44 void OnInitialized() override; | 31 void OnInitialized() override; |
45 | 32 |
(...skipping 14 matching lines...) Expand all Loading... |
60 | 47 |
61 base::CancelableTaskTracker cancelable_task_tracker_; | 48 base::CancelableTaskTracker cancelable_task_tracker_; |
62 scoped_refptr<password_manager::PasswordStore> store_; | 49 scoped_refptr<password_manager::PasswordStore> store_; |
63 syncer::SyncService* sync_service_; | 50 syncer::SyncService* sync_service_; |
64 bool password_sync_enabled_; | 51 bool password_sync_enabled_; |
65 }; | 52 }; |
66 | 53 |
67 } // namespace browsing_data | 54 } // namespace browsing_data |
68 | 55 |
69 #endif // COMPONENTS_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ | 56 #endif // COMPONENTS_BROWSING_DATA_CORE_COUNTERS_PASSWORDS_COUNTER_H_ |
OLD | NEW |