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

Unified Diff: chrome/browser/ui/webui/history_ui.h

Issue 12381081: History: Add UMA collection for full history sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/history_ui.h
diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h
index 8f3e8248f4c90c19a27abdc63e0d4d60c0fa965a..8280e0116d7d2615450cae84da7a1cb6107bdd5d 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -30,24 +30,35 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// a local or remote visit. A single entry can represent multiple visits,
// since only the most recent visit on a particular day is shown.
struct HistoryEntry {
- HistoryEntry(const GURL& url, const string16& title, base::Time time,
- const std::set<int64>& timestamps, bool is_search_result,
- const string16& snippet);
+ // Values indicating whether an entry represents only local visits, only
+ // remote visits, or a mixture of both.
+ enum EntryType {
+ LOCAL_ENTRY,
+ REMOTE_ENTRY,
+ COMBINED_ENTRY
+ };
+
+ HistoryEntry(EntryType type, const GURL& url, const string16& title,
+ base::Time time, const std::set<int64>& timestamps,
+ bool is_search_result, const string16& snippet);
HistoryEntry();
virtual ~HistoryEntry();
// Formats this entry's URL and title and adds them to |result|.
- void SetUrlAndTitle(DictionaryValue* result);
+ void SetUrlAndTitle(DictionaryValue* result) const;
// Converts the entry to a DictionaryValue to be owned by the caller.
scoped_ptr<DictionaryValue> ToValue(
BookmarkModel* bookmark_model,
- ManagedUserService* managed_user_service);
+ ManagedUserService* managed_user_service) const;
// Comparison function for sorting HistoryEntries from newest to oldest.
static bool SortByTimeDescending(
const HistoryEntry& entry1, const HistoryEntry& entry2);
+ // The type of visits this entry represents: local, remote, or both.
+ EntryType entry_type;
+
GURL url;
string16 title; // Title of the entry. May be empty.
@@ -128,12 +139,9 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Core implementation of history querying.
void QueryHistory(string16 search_text, const history::QueryOptions& options);
- // Sends the accumulated results of the query to the front end, truncating
- // the number to |max_count| if necessary. If |max_count| is 0, the results
- // are not truncated.
- // If |remove_duplicates| is true, duplicate visits on the same day are
- // removed.
- void ReturnResultsToFrontEnd(bool remove_duplicates, int max_count);
+ // Combines the query results from the local history database and the history
+ // server, and sends the combined results to the front end.
+ void ReturnResultsToFrontEnd();
// Callback from |web_history_timer_| when a response from web history has
// not been received in time.
@@ -148,6 +156,7 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Callback from the WebHistoryService when a query has completed.
void WebHistoryQueryComplete(const string16& search_text,
const history::QueryOptions& options,
+ base::TimeTicks start_time,
history::WebHistoryService::Request* request,
const base::DictionaryValue* results_value);
@@ -194,9 +203,12 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// The info value that is returned to the front end with the query results.
base::DictionaryValue results_info_value_;
- // The list of query results that is returned to the front end.
+ // The list of query results received from the history service.
std::vector<HistoryEntry> query_results_;
+ // The list of query results received from the history server.
+ std::vector<HistoryEntry> web_history_query_results_;
+
// Timer used to implement a timeout on a Web History response.
base::OneShotTimer<BrowsingHistoryHandler> web_history_timer_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698