diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 22:26:06 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 22:26:06 +0000 |
commit | fbf644e73feb4e48db8739344f3c62cdccec0832 (patch) | |
tree | d9b2eafafb3c7185d6dffb1a276990eb50cb413c /chrome/browser/dom_ui/history_ui.h | |
parent | 12e14fcf977c5a4be6dd8e2778ac13382e2bf08a (diff) | |
download | chromium_src-fbf644e73feb4e48db8739344f3c62cdccec0832.zip chromium_src-fbf644e73feb4e48db8739344f3c62cdccec0832.tar.gz chromium_src-fbf644e73feb4e48db8739344f3c62cdccec0832.tar.bz2 |
* Add day deletion to history
* Speed up history viewing by swapping the search depth to day rather than month - it's now orders of magnitude faster for people who visit more than 30 pages a day, and very slightly slower for people who visit less than 10 pages a day.
Review URL: http://codereview.chromium.org/21182
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/history_ui.h')
-rw-r--r-- | chrome/browser/dom_ui/history_ui.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/history_ui.h b/chrome/browser/dom_ui/history_ui.h index 742cf81..96efd3e 100644 --- a/chrome/browser/dom_ui/history_ui.h +++ b/chrome/browser/dom_ui/history_ui.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_DOM_UI_HISTORY_UI_H__ #define CHROME_BROWSER_DOM_UI_HISTORY_UI_H__ +#include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/dom_ui.h" #include "chrome/browser/dom_ui/dom_ui_contents.h" @@ -28,7 +29,8 @@ class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource { // The handler for Javascript messages related to the "history" view. class BrowsingHistoryHandler : public DOMMessageHandler, - public NotificationObserver { + public NotificationObserver, + public BrowsingDataRemover::Observer { public: explicit BrowsingHistoryHandler(DOMUI* dom_ui_); virtual ~BrowsingHistoryHandler(); @@ -36,28 +38,39 @@ class BrowsingHistoryHandler : public DOMMessageHandler, // Callback for the "getHistory" message. void HandleGetHistory(const Value* value); + // Callback for the "searchHistory" message. + void HandleSearchHistory(const Value* value); + + // Callback for the "deleteDay" message. + void HandleDeleteDay(const Value* value); + // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); + // BrowsingDataRemover observer implementation. + void OnBrowsingDataRemoverDone(); + private: - // Callback from the history system when the most visited list is available. + // Callback from the history system when the history list is available. void QueryComplete(HistoryService::Handle request_handle, history::QueryResults* results); - // Extract the arguments from the call to HandleGetHistory. - void ExtractGetHistoryArguments(const Value* value, - int* month, - std::wstring* query); + // Extract the arguments from the call to HandleSearchHistory. + void ExtractSearchHistoryArguments(const Value* value, + int* month, + std::wstring* query); - // Get the query options for a given month and query. - history::QueryOptions CreateQueryOptions(int month, - const std::wstring& query); + // Figure out the query options for a month-wide query. + history::QueryOptions CreateMonthQueryOptions(int month); // Current search text. std::wstring search_text_; + // Browsing history remover + BrowsingDataRemover* remover_; + // Our consumer for the history service. CancelableRequestConsumerT<PageUsageData*, NULL> cancelable_consumer_; |