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

Side by Side Diff: chrome/browser/ui/webui/history_ui.h

Issue 10392084: WIP for integration between Chrome and Google Web History. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More work. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/web_history_service.cc ('k') | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/browser/cancelable_request.h" 12 #include "chrome/browser/cancelable_request.h"
13 #include "chrome/browser/history/history.h" 13 #include "chrome/browser/history/history.h"
14 #include "chrome/browser/history/web_history_service.h"
14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 15 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
15 #include "content/public/browser/notification_registrar.h" 16 #include "content/public/browser/notification_registrar.h"
16 #include "content/public/browser/web_ui_controller.h" 17 #include "content/public/browser/web_ui_controller.h"
17 #include "content/public/browser/web_ui_message_handler.h" 18 #include "content/public/browser/web_ui_message_handler.h"
18 19
19 // The handler for Javascript messages related to the "history" view. 20 // The handler for Javascript messages related to the "history" view.
20 class BrowsingHistoryHandler : public content::WebUIMessageHandler, 21 class BrowsingHistoryHandler : public content::WebUIMessageHandler,
21 public content::NotificationObserver { 22 public content::NotificationObserver {
22 public: 23 public:
23 BrowsingHistoryHandler(); 24 BrowsingHistoryHandler();
(...skipping 16 matching lines...) Expand all
40 41
41 // Handler for "removeBookmark" message. 42 // Handler for "removeBookmark" message.
42 void HandleRemoveBookmark(const base::ListValue* args); 43 void HandleRemoveBookmark(const base::ListValue* args);
43 44
44 // content::NotificationObserver implementation. 45 // content::NotificationObserver implementation.
45 virtual void Observe(int type, 46 virtual void Observe(int type,
46 const content::NotificationSource& source, 47 const content::NotificationSource& source,
47 const content::NotificationDetails& details) OVERRIDE; 48 const content::NotificationDetails& details) OVERRIDE;
48 49
49 private: 50 private:
51 // Helper used by handlers getHistory and searchHistory.
52 void QueryHistory(const string16& text_query,
53 const history::QueryOptions& options);
54
50 // Callback from the history system when the history list is available. 55 // Callback from the history system when the history list is available.
51 void QueryComplete(HistoryService::Handle request_handle, 56 void QueryComplete(HistoryService::Handle request_handle,
52 history::QueryResults* results); 57 history::QueryResults* results);
53 58
59 // Callback from the WebHistory service with results from Web History.
60 void WebHistoryQueryComplete();
61
54 // Callback from the history system when visits were deleted. 62 // Callback from the history system when visits were deleted.
55 void RemoveComplete(); 63 void RemoveComplete();
56 64
57 // Extract the arguments from the call to HandleSearchHistory. 65 // Extract the arguments from the call to HandleSearchHistory.
58 void ExtractSearchHistoryArguments(const base::ListValue* args, 66 void ExtractSearchHistoryArguments(const base::ListValue* args,
59 int* month, 67 int* month,
60 string16* query); 68 string16* query);
61 69
62 // Figure out the query options for a month-wide query. 70 // Figure out the query options for a month-wide query.
63 history::QueryOptions CreateMonthQueryOptions(int month); 71 history::QueryOptions CreateMonthQueryOptions(int month);
(...skipping 22 matching lines...) Expand all
86 // Return the URL for a given search term. 94 // Return the URL for a given search term.
87 static const GURL GetHistoryURLWithSearchText(const string16& text); 95 static const GURL GetHistoryURLWithSearchText(const string16& text);
88 96
89 static base::RefCountedMemory* GetFaviconResourceBytes(); 97 static base::RefCountedMemory* GetFaviconResourceBytes();
90 98
91 private: 99 private:
92 DISALLOW_COPY_AND_ASSIGN(HistoryUI); 100 DISALLOW_COPY_AND_ASSIGN(HistoryUI);
93 }; 101 };
94 102
95 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ 103 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/web_history_service.cc ('k') | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698