OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 public NotificationObserver { | 22 public NotificationObserver { |
23 public: | 23 public: |
24 BrowsingHistoryHandler(); | 24 BrowsingHistoryHandler(); |
25 virtual ~BrowsingHistoryHandler(); | 25 virtual ~BrowsingHistoryHandler(); |
26 | 26 |
27 // WebUIMessageHandler implementation. | 27 // WebUIMessageHandler implementation. |
28 virtual WebUIMessageHandler* Attach(WebUI* web_ui); | 28 virtual WebUIMessageHandler* Attach(WebUI* web_ui); |
29 virtual void RegisterMessages(); | 29 virtual void RegisterMessages(); |
30 | 30 |
31 // Callback for the "getHistory" message. | 31 // Callback for the "getHistory" message. |
32 void HandleGetHistory(const ListValue* args); | 32 void HandleGetHistory(const base::ListValue* args); |
33 | 33 |
34 // Callback for the "searchHistory" message. | 34 // Callback for the "searchHistory" message. |
35 void HandleSearchHistory(const ListValue* args); | 35 void HandleSearchHistory(const base::ListValue* args); |
36 | 36 |
37 // Callback for the "removeURLsOnOneDay" message. | 37 // Callback for the "removeURLsOnOneDay" message. |
38 void HandleRemoveURLsOnOneDay(const ListValue* args); | 38 void HandleRemoveURLsOnOneDay(const base::ListValue* args); |
39 | 39 |
40 // Handle for "clearBrowsingData" message. | 40 // Handle for "clearBrowsingData" message. |
41 void HandleClearBrowsingData(const ListValue* args); | 41 void HandleClearBrowsingData(const base::ListValue* args); |
42 | 42 |
43 // NotificationObserver implementation. | 43 // NotificationObserver implementation. |
44 virtual void Observe(int type, | 44 virtual void Observe(int type, |
45 const NotificationSource& source, | 45 const NotificationSource& source, |
46 const NotificationDetails& details); | 46 const NotificationDetails& details); |
47 | 47 |
48 private: | 48 private: |
49 // Callback from the history system when the history list is available. | 49 // Callback from the history system when the history list is available. |
50 void QueryComplete(HistoryService::Handle request_handle, | 50 void QueryComplete(HistoryService::Handle request_handle, |
51 history::QueryResults* results); | 51 history::QueryResults* results); |
52 | 52 |
53 // Callback from the history system when visits were deleted. | 53 // Callback from the history system when visits were deleted. |
54 void RemoveComplete(); | 54 void RemoveComplete(); |
55 | 55 |
56 // Extract the arguments from the call to HandleSearchHistory. | 56 // Extract the arguments from the call to HandleSearchHistory. |
57 void ExtractSearchHistoryArguments(const ListValue* args, | 57 void ExtractSearchHistoryArguments(const base::ListValue* args, |
58 int* month, | 58 int* month, |
59 string16* query); | 59 string16* query); |
60 | 60 |
61 // Figure out the query options for a month-wide query. | 61 // Figure out the query options for a month-wide query. |
62 history::QueryOptions CreateMonthQueryOptions(int month); | 62 history::QueryOptions CreateMonthQueryOptions(int month); |
63 | 63 |
64 NotificationRegistrar registrar_; | 64 NotificationRegistrar registrar_; |
65 | 65 |
66 // Current search text. | 66 // Current search text. |
67 string16 search_text_; | 67 string16 search_text_; |
(...skipping 14 matching lines...) Expand all Loading... |
82 // Return the URL for a given search term. | 82 // Return the URL for a given search term. |
83 static const GURL GetHistoryURLWithSearchText(const string16& text); | 83 static const GURL GetHistoryURLWithSearchText(const string16& text); |
84 | 84 |
85 static RefCountedMemory* GetFaviconResourceBytes(); | 85 static RefCountedMemory* GetFaviconResourceBytes(); |
86 | 86 |
87 private: | 87 private: |
88 DISALLOW_COPY_AND_ASSIGN(HistoryUI); | 88 DISALLOW_COPY_AND_ASSIGN(HistoryUI); |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ | 91 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ |
OLD | NEW |