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

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: Created 7 years, 10 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 9cd8d449c9985790290aa6fc72032c763445e366..3d6e46a7d4161b52ce7f0c005e9619402f1da240 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -30,24 +30,34 @@ 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,
James Hawkins 2013/03/04 19:09:45 nit: The start of parameter rows must align on the
Patrick Dubroy 2013/03/05 13:15:54 Fixed. So google-style.el *was* doing the right th
+ bool is_search_result, const string16& snippet);
HistoryEntry();
virtual ~HistoryEntry();
// Format this entry's URL and title and add them to |result|.
- void SetUrlAndTitle(DictionaryValue* result);
+ void SetUrlAndTitle(DictionaryValue* result) const;
// Convert 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);
+ EntryType entry_type;
James Hawkins 2013/03/04 19:09:45 Optional nit: The type name itself is not quite de
Patrick Dubroy 2013/03/05 13:15:54 Done.
+
GURL url;
string16 title; // Title of the entry. May be empty.
@@ -128,12 +138,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 +155,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 +202,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