OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ |
6 #define IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 COMBINED_ENTRY | 53 COMBINED_ENTRY |
54 }; | 54 }; |
55 | 55 |
56 HistoryEntry(EntryType type, | 56 HistoryEntry(EntryType type, |
57 const GURL& url, | 57 const GURL& url, |
58 const base::string16& title, | 58 const base::string16& title, |
59 base::Time time, | 59 base::Time time, |
60 const std::string& client_id, | 60 const std::string& client_id, |
61 bool is_search_result, | 61 bool is_search_result, |
62 const base::string16& snippet, | 62 const base::string16& snippet, |
63 bool blocked_visit, | 63 bool blocked_visit); |
64 const std::string& accept_languages); | |
65 HistoryEntry(); | 64 HistoryEntry(); |
66 virtual ~HistoryEntry(); | 65 virtual ~HistoryEntry(); |
67 | 66 |
68 // Formats this entry's URL and title and adds them to |result|. | 67 // Formats this entry's URL and title and adds them to |result|. |
69 void SetUrlAndTitle(base::DictionaryValue* result) const; | 68 void SetUrlAndTitle(base::DictionaryValue* result) const; |
70 | 69 |
71 // Converts the entry to a DictionaryValue to be owned by the caller. | 70 // Converts the entry to a DictionaryValue to be owned by the caller. |
72 scoped_ptr<base::DictionaryValue> ToValue( | 71 scoped_ptr<base::DictionaryValue> ToValue( |
73 bookmarks::BookmarkModel* bookmark_model, | 72 bookmarks::BookmarkModel* bookmark_model, |
74 SupervisedUserService* supervised_user_service, | 73 SupervisedUserService* supervised_user_service, |
(...skipping 20 matching lines...) Expand all Loading... |
95 std::set<int64_t> all_timestamps; | 94 std::set<int64_t> all_timestamps; |
96 | 95 |
97 // If true, this entry is a search result. | 96 // If true, this entry is a search result. |
98 bool is_search_result; | 97 bool is_search_result; |
99 | 98 |
100 // The entry's search snippet, if this entry is a search result. | 99 // The entry's search snippet, if this entry is a search result. |
101 base::string16 snippet; | 100 base::string16 snippet; |
102 | 101 |
103 // Whether this entry was blocked when it was attempted. | 102 // Whether this entry was blocked when it was attempted. |
104 bool blocked_visit; | 103 bool blocked_visit; |
105 | |
106 // kAcceptLanguages pref value. | |
107 std::string accept_languages; | |
108 }; | 104 }; |
109 | 105 |
110 BrowsingHistoryHandler(); | 106 BrowsingHistoryHandler(); |
111 ~BrowsingHistoryHandler() override; | 107 ~BrowsingHistoryHandler() override; |
112 | 108 |
113 // WebUIMessageHandler implementation. | 109 // WebUIMessageHandler implementation. |
114 void RegisterMessages() override; | 110 void RegisterMessages() override; |
115 | 111 |
116 // Handler for the "queryHistory" message. | 112 // Handler for the "queryHistory" message. |
117 void HandleQueryHistory(const base::ListValue* args); | 113 void HandleQueryHistory(const base::ListValue* args); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 bool ExtractIntegerValueAtIndex(const base::ListValue* value, | 167 bool ExtractIntegerValueAtIndex(const base::ListValue* value, |
172 int index, | 168 int index, |
173 int* out_int); | 169 int* out_int); |
174 | 170 |
175 // Sets the query options for a week-wide query, |offset| weeks ago. | 171 // Sets the query options for a week-wide query, |offset| weeks ago. |
176 void SetQueryTimeInWeeks(int offset, history::QueryOptions* options); | 172 void SetQueryTimeInWeeks(int offset, history::QueryOptions* options); |
177 | 173 |
178 // Sets the query options for a monthly query, |offset| months ago. | 174 // Sets the query options for a monthly query, |offset| months ago. |
179 void SetQueryTimeInMonths(int offset, history::QueryOptions* options); | 175 void SetQueryTimeInMonths(int offset, history::QueryOptions* options); |
180 | 176 |
181 // kAcceptLanguages pref value. | |
182 std::string GetAcceptLanguages() const; | |
183 | |
184 // history::HistoryServiceObserver: | 177 // history::HistoryServiceObserver: |
185 void OnURLsDeleted(history::HistoryService* history_service, | 178 void OnURLsDeleted(history::HistoryService* history_service, |
186 bool all_history, | 179 bool all_history, |
187 bool expired, | 180 bool expired, |
188 const history::URLRows& deleted_rows, | 181 const history::URLRows& deleted_rows, |
189 const std::set<GURL>& favicon_urls) override; | 182 const std::set<GURL>& favicon_urls) override; |
190 | 183 |
191 // Tracker for search requests to the history service. | 184 // Tracker for search requests to the history service. |
192 base::CancelableTaskTracker query_task_tracker_; | 185 base::CancelableTaskTracker query_task_tracker_; |
193 | 186 |
(...skipping 24 matching lines...) Expand all Loading... |
218 | 211 |
219 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 212 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
220 history_service_observer_; | 213 history_service_observer_; |
221 | 214 |
222 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; | 215 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; |
223 | 216 |
224 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); | 217 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); |
225 }; | 218 }; |
226 | 219 |
227 #endif // IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ | 220 #endif // IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ |
OLD | NEW |