Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/browsing_data/history_counter.h

Issue 1420013004: Polish the result communication and display of the browsing data counters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved Value() to FinishedResult. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_
7 7
8 #include "base/task/cancelable_task_tracker.h" 8 #include "base/task/cancelable_task_tracker.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "chrome/browser/browsing_data/browsing_data_counter.h" 10 #include "chrome/browser/browsing_data/browsing_data_counter.h"
11 #include "components/history/core/browser/history_service.h" 11 #include "components/history/core/browser/history_service.h"
12 #include "components/history/core/browser/web_history_service.h" 12 #include "components/history/core/browser/web_history_service.h"
13 13
14 class HistoryCounter: public BrowsingDataCounter { 14 class HistoryCounter: public BrowsingDataCounter {
15 public: 15 public:
16 // A special value indicating that the local counting result is zero, but some 16 class HistoryResult : public FinishedResult {
17 // history entries exist in Sync. 17 public:
18 // TODO(msramek): Change the callback signature so we can return a structured 18 HistoryResult(const HistoryCounter* source,
19 // result instead of special int values. 19 ResultInt value,
20 static const BrowsingDataCounter::ResultInt kOnlySyncedHistory; 20 bool has_synced_visits);
21 ~HistoryResult() override;
22
23 bool has_synced_visits() const { return has_synced_visits_; }
24
25 private:
26 bool has_synced_visits_;
27 };
21 28
22 HistoryCounter(); 29 HistoryCounter();
23 ~HistoryCounter() override; 30 ~HistoryCounter() override;
24 31
25 const std::string& GetPrefName() const override; 32 const std::string& GetPrefName() const override;
26 33
27 // Whether there are counting tasks in progress. Only used for testing. 34 // Whether there are counting tasks in progress. Only used for testing.
28 bool HasTrackedTasks(); 35 bool HasTrackedTasks();
29 36
30 // Make the history counter use a custom WebHistoryService instance. Only 37 // Make the history counter use a custom WebHistoryService instance. Only
(...skipping 20 matching lines...) Expand all
51 void Count() override; 58 void Count() override;
52 59
53 void OnGetLocalHistoryCount(history::HistoryCountResult result); 60 void OnGetLocalHistoryCount(history::HistoryCountResult result);
54 void OnGetWebHistoryCount(history::WebHistoryService::Request* request, 61 void OnGetWebHistoryCount(history::WebHistoryService::Request* request,
55 const base::DictionaryValue* result); 62 const base::DictionaryValue* result);
56 void OnWebHistoryTimeout(); 63 void OnWebHistoryTimeout();
57 void MergeResults(); 64 void MergeResults();
58 }; 65 };
59 66
60 #endif // CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_ 67 #endif // CHROME_BROWSER_BROWSING_DATA_HISTORY_COUNTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698