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 <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/scoped_observer.h" | 15 #include "base/scoped_observer.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/task/cancelable_task_tracker.h" | 17 #include "base/task/cancelable_task_tracker.h" |
18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "components/history/core/browser/history_service_observer.h" | 20 #include "components/history/core/browser/history_service_observer.h" |
21 #include "components/history/core/browser/url_row.h" | 21 #include "components/history/core/browser/url_row.h" |
22 #include "components/history/core/browser/web_history_service.h" | 22 #include "components/history/core/browser/web_history_service.h" |
23 #include "ios/public/provider/web/web_ui_ios_message_handler.h" | 23 #include "ios/public/provider/web/web_ui_ios_message_handler.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 HistoryEntry(); | 64 HistoryEntry(); |
65 virtual ~HistoryEntry(); | 65 virtual ~HistoryEntry(); |
66 | 66 |
67 // 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|. |
68 void SetUrlAndTitle(base::DictionaryValue* result) const; | 68 void SetUrlAndTitle(base::DictionaryValue* result) const; |
69 | 69 |
70 // 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. |
71 scoped_ptr<base::DictionaryValue> ToValue( | 71 std::unique_ptr<base::DictionaryValue> ToValue( |
72 bookmarks::BookmarkModel* bookmark_model, | 72 bookmarks::BookmarkModel* bookmark_model, |
73 SupervisedUserService* supervised_user_service, | 73 SupervisedUserService* supervised_user_service, |
74 const ProfileSyncService* sync_service) const; | 74 const ProfileSyncService* sync_service) const; |
75 | 75 |
76 // Comparison function for sorting HistoryEntries from newest to oldest. | 76 // Comparison function for sorting HistoryEntries from newest to oldest. |
77 static bool SortByTimeDescending(const HistoryEntry& entry1, | 77 static bool SortByTimeDescending(const HistoryEntry& entry1, |
78 const HistoryEntry& entry2); | 78 const HistoryEntry& entry2); |
79 | 79 |
80 // The type of visits this entry represents: local, remote, or both. | 80 // The type of visits this entry represents: local, remote, or both. |
81 EntryType entry_type; | 81 EntryType entry_type; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 bool all_history, | 179 bool all_history, |
180 bool expired, | 180 bool expired, |
181 const history::URLRows& deleted_rows, | 181 const history::URLRows& deleted_rows, |
182 const std::set<GURL>& favicon_urls) override; | 182 const std::set<GURL>& favicon_urls) override; |
183 | 183 |
184 // Tracker for search requests to the history service. | 184 // Tracker for search requests to the history service. |
185 base::CancelableTaskTracker query_task_tracker_; | 185 base::CancelableTaskTracker query_task_tracker_; |
186 | 186 |
187 // The currently-executing request for synced history results. | 187 // The currently-executing request for synced history results. |
188 // Deleting the request will cancel it. | 188 // Deleting the request will cancel it. |
189 scoped_ptr<history::WebHistoryService::Request> web_history_request_; | 189 std::unique_ptr<history::WebHistoryService::Request> web_history_request_; |
190 | 190 |
191 // True if there is a pending delete requests to the history service. | 191 // True if there is a pending delete requests to the history service. |
192 bool has_pending_delete_request_; | 192 bool has_pending_delete_request_; |
193 | 193 |
194 // Tracker for delete requests to the history service. | 194 // Tracker for delete requests to the history service. |
195 base::CancelableTaskTracker delete_task_tracker_; | 195 base::CancelableTaskTracker delete_task_tracker_; |
196 | 196 |
197 // The list of URLs that are in the process of being deleted. | 197 // The list of URLs that are in the process of being deleted. |
198 std::set<GURL> urls_to_be_deleted_; | 198 std::set<GURL> urls_to_be_deleted_; |
199 | 199 |
(...skipping 11 matching lines...) Expand all Loading... |
211 | 211 |
212 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 212 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
213 history_service_observer_; | 213 history_service_observer_; |
214 | 214 |
215 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; | 215 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; |
216 | 216 |
217 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); | 217 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); |
218 }; | 218 }; |
219 | 219 |
220 #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 |