msramek | 8be3328 | 2015-10-06 14:33:21 | [diff] [blame^] | 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. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ |
| 6 | #define CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ |
| 7 | |
| 8 | #include "base/task/cancelable_task_tracker.h" |
| 9 | #include "chrome/browser/browsing_data/browsing_data_counter.h" |
| 10 | #include "components/history/core/browser/history_service.h" |
| 11 | |
| 12 | namespace history { |
| 13 | class QueryResults; |
| 14 | } |
| 15 | |
| 16 | class HistoryCounter: public BrowsingDataCounter { |
| 17 | public: |
| 18 | HistoryCounter(); |
| 19 | ~HistoryCounter() override; |
| 20 | |
| 21 | const std::string& GetPrefName() const override; |
| 22 | |
| 23 | // Whether there are counting tasks in progress. Only used for testing. |
| 24 | bool HasTrackedTasks(); |
| 25 | |
| 26 | private: |
| 27 | const std::string pref_name_; |
| 28 | base::CancelableTaskTracker cancelable_task_tracker_; |
| 29 | |
| 30 | void Count() override; |
| 31 | |
| 32 | void OnGetLocalHistoryCount(history::HistoryCountResult result); |
| 33 | }; |
| 34 | |
| 35 | #endif // CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ |