Chromium Code Reviews| 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_; |