OLD | NEW |
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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void Observe(int type, | 44 virtual void Observe(int type, |
45 const content::NotificationSource& source, | 45 const content::NotificationSource& source, |
46 const content::NotificationDetails& details) OVERRIDE; | 46 const content::NotificationDetails& details) OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 // The range for which to return results: | 49 // The range for which to return results: |
50 // - ALLTIME: allows access to all the results in a paginated way. | 50 // - ALLTIME: allows access to all the results in a paginated way. |
51 // - WEEK: the last 7 days. | 51 // - WEEK: the last 7 days. |
52 // - MONTH: the last calendar month. | 52 // - MONTH: the last calendar month. |
53 enum Range { | 53 enum Range { |
54 ALLTIME = 0, | 54 ALL_TIME = 0, |
55 WEEK = 1, | 55 WEEK = 1, |
56 MONTH = 2 | 56 MONTH = 2 |
57 }; | 57 }; |
58 | 58 |
59 // Core implementation of history querying. | 59 // Core implementation of history querying. |
60 void QueryHistory(string16 search_text, const history::QueryOptions& options); | 60 void QueryHistory(string16 search_text, const history::QueryOptions& options); |
61 | 61 |
62 // Creates a history query result value. | 62 // Creates a history query result value. |
63 DictionaryValue* CreateQueryResultValue( | 63 DictionaryValue* CreateQueryResultValue( |
64 const GURL& url, const string16 title, base::Time visit_time, | 64 const GURL& url, const string16 title, base::Time visit_time, |
(...skipping 21 matching lines...) Expand all Loading... |
86 // Callback from the history system when visits were deleted. | 86 // Callback from the history system when visits were deleted. |
87 void RemoveComplete(); | 87 void RemoveComplete(); |
88 | 88 |
89 // Callback from history server when visits were deleted. | 89 // Callback from history server when visits were deleted. |
90 void RemoveWebHistoryComplete(history::WebHistoryService::Request* request, | 90 void RemoveWebHistoryComplete(history::WebHistoryService::Request* request, |
91 bool success); | 91 bool success); |
92 | 92 |
93 bool ExtractIntegerValueAtIndex( | 93 bool ExtractIntegerValueAtIndex( |
94 const base::ListValue* value, int index, int* out_int); | 94 const base::ListValue* value, int index, int* out_int); |
95 | 95 |
96 // Set the query options for a month-wide query. | 96 // Set the query options for a week-wide query, |offset| weeks ago. |
97 void SetQueryTimeInMonths(history::QueryOptions* options); | 97 void SetQueryTimeInWeeks(int offset, history::QueryOptions* options); |
98 | 98 |
99 // Set the query options for a week-wide query. | 99 // Sets the query options for a monthly query, |offset| months ago. |
100 void SetQueryTimeInWeeks(history::QueryOptions* options); | 100 void SetQueryTimeInMonths(int offset, history::QueryOptions* options); |
101 | 101 |
102 content::NotificationRegistrar registrar_; | 102 content::NotificationRegistrar registrar_; |
103 | 103 |
104 // Consumer for search requests to the history service. | 104 // Consumer for search requests to the history service. |
105 CancelableRequestConsumerT<int, 0> history_request_consumer_; | 105 CancelableRequestConsumerT<int, 0> history_request_consumer_; |
106 | 106 |
107 // The currently-executing request for synced history results. | 107 // The currently-executing request for synced history results. |
108 // Deleting the request will cancel it. | 108 // Deleting the request will cancel it. |
109 scoped_ptr<history::WebHistoryService::Request> web_history_request_; | 109 scoped_ptr<history::WebHistoryService::Request> web_history_request_; |
110 | 110 |
(...skipping 27 matching lines...) Expand all Loading... |
138 static const GURL GetHistoryURLWithSearchText(const string16& text); | 138 static const GURL GetHistoryURLWithSearchText(const string16& text); |
139 | 139 |
140 static base::RefCountedMemory* GetFaviconResourceBytes( | 140 static base::RefCountedMemory* GetFaviconResourceBytes( |
141 ui::ScaleFactor scale_factor); | 141 ui::ScaleFactor scale_factor); |
142 | 142 |
143 private: | 143 private: |
144 DISALLOW_COPY_AND_ASSIGN(HistoryUI); | 144 DISALLOW_COPY_AND_ASSIGN(HistoryUI); |
145 }; | 145 }; |
146 | 146 |
147 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ | 147 #endif // CHROME_BROWSER_UI_WEBUI_HISTORY_UI_H_ |
OLD | NEW |