OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 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 | 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_HISTORY_COUNTER_H_ | 5 #ifndef COMPONENTS_BROWSING_DATA_CORE_COUNTERS_HISTORY_COUNTER_H_ |
6 #define COMPONENTS_BROWSING_DATA_CORE_COUNTERS_HISTORY_COUNTER_H_ | 6 #define COMPONENTS_BROWSING_DATA_CORE_COUNTERS_HISTORY_COUNTER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
12 #include "components/browsing_data/core/counters/browsing_data_counter.h" | 12 #include "components/browsing_data/core/counters/browsing_data_counter.h" |
13 #include "components/history/core/browser/history_service.h" | 13 #include "components/history/core/browser/history_service.h" |
14 #include "components/history/core/browser/web_history_service.h" | 14 #include "components/history/core/browser/web_history_service.h" |
15 #include "components/sync/driver/sync_service.h" | 15 #include "components/sync/driver/sync_service.h" |
16 #include "components/sync/driver/sync_service_observer.h" | 16 #include "components/sync/driver/sync_service_observer.h" |
17 | 17 |
18 namespace browsing_data { | 18 namespace browsing_data { |
19 | 19 |
20 class HistoryCounter : public browsing_data::BrowsingDataCounter, | 20 class HistoryCounter : public browsing_data::BrowsingDataCounter, |
21 public syncer::SyncServiceObserver { | 21 public syncer::SyncServiceObserver { |
22 public: | 22 public: |
23 typedef base::Callback<history::WebHistoryService*()> | 23 typedef base::Callback<history::WebHistoryService*()> |
24 GetUpdatedWebHistoryServiceCallback; | 24 GetUpdatedWebHistoryServiceCallback; |
25 | 25 |
26 class HistoryResult : public FinishedResult { | 26 class HistoryResult : public SyncResult { |
27 public: | 27 public: |
28 HistoryResult(const HistoryCounter* source, | 28 HistoryResult(const HistoryCounter* source, |
29 ResultInt value, | 29 ResultInt value, |
| 30 bool is_sync_enabled, |
30 bool has_synced_visits); | 31 bool has_synced_visits); |
31 ~HistoryResult() override; | 32 ~HistoryResult() override; |
32 | 33 |
33 bool has_synced_visits() const { return has_synced_visits_; } | 34 bool has_synced_visits() const { return has_synced_visits_; } |
34 | 35 |
35 private: | 36 private: |
36 bool has_synced_visits_; | 37 bool has_synced_visits_; |
37 }; | 38 }; |
38 | 39 |
39 explicit HistoryCounter(history::HistoryService* history_service, | 40 explicit HistoryCounter(history::HistoryService* history_service, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 BrowsingDataCounter::ResultInt local_result_; | 81 BrowsingDataCounter::ResultInt local_result_; |
81 | 82 |
82 bool history_sync_enabled_; | 83 bool history_sync_enabled_; |
83 | 84 |
84 base::WeakPtrFactory<HistoryCounter> weak_ptr_factory_; | 85 base::WeakPtrFactory<HistoryCounter> weak_ptr_factory_; |
85 }; | 86 }; |
86 | 87 |
87 } // namespace browsing_data | 88 } // namespace browsing_data |
88 | 89 |
89 #endif // COMPONENTS_BROWSING_DATA_CORE_COUNTERS_HISTORY_COUNTER_H_ | 90 #endif // COMPONENTS_BROWSING_DATA_CORE_COUNTERS_HISTORY_COUNTER_H_ |
OLD | NEW |