summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/history_ui.h
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-07 23:48:03 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-07 23:48:03 +0000
commit76a010b47593d41d1d443dacc51bc906689c2e53 (patch)
tree28f61efd20f447d21bb5ca3e8582b29994c79eba /chrome/browser/dom_ui/history_ui.h
parent85ad84eba6540630a33ab7bfa37c2d37c4a9554d (diff)
downloadchromium_src-76a010b47593d41d1d443dacc51bc906689c2e53.zip
chromium_src-76a010b47593d41d1d443dacc51bc906689c2e53.tar.gz
chromium_src-76a010b47593d41d1d443dacc51bc906689c2e53.tar.bz2
Reupload of 12418
Review URL: http://codereview.chromium.org/13183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/history_ui.h')
-rw-r--r--chrome/browser/dom_ui/history_ui.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/history_ui.h b/chrome/browser/dom_ui/history_ui.h
new file mode 100644
index 0000000..742cf81
--- /dev/null
+++ b/chrome/browser/dom_ui/history_ui.h
@@ -0,0 +1,83 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DOM_UI_HISTORY_UI_H__
+#define CHROME_BROWSER_DOM_UI_HISTORY_UI_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"
+
+class GURL;
+
+class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource {
+ public:
+ HistoryUIHTMLSource();
+
+ // Called when the network layer has requested a resource underneath
+ // the path we registered.
+ virtual void StartDataRequest(const std::string& path, int request_id);
+ virtual std::string GetMimeType(const std::string&) const {
+ return "text/html";
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource);
+};
+
+// The handler for Javascript messages related to the "history" view.
+class BrowsingHistoryHandler : public DOMMessageHandler,
+ public NotificationObserver {
+ public:
+ explicit BrowsingHistoryHandler(DOMUI* dom_ui_);
+ virtual ~BrowsingHistoryHandler();
+
+ // Callback for the "getHistory" message.
+ void HandleGetHistory(const Value* value);
+
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ // Callback from the history system when the most visited 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);
+
+ // Get the query options for a given month and query.
+ history::QueryOptions CreateQueryOptions(int month,
+ const std::wstring& query);
+
+ // Current search text.
+ std::wstring search_text_;
+
+ // Our consumer for the history service.
+ CancelableRequestConsumerT<PageUsageData*, NULL> cancelable_consumer_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
+};
+
+class HistoryUI : public DOMUI {
+ public:
+ explicit HistoryUI(DOMUIContents* contents);
+
+ // Return the URL for the front page of this UI.
+ static GURL GetBaseURL();
+
+ // DOMUI Implementation
+ virtual void Init();
+
+ private:
+ DOMUIContents* contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(HistoryUI);
+};
+
+#endif // CHROME_BROWSER_DOM_UI_HISTORY_UI_H__ \ No newline at end of file