OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSING_HISTORY_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 enum EntryType { | 49 enum EntryType { |
50 EMPTY_ENTRY = 0, | 50 EMPTY_ENTRY = 0, |
51 LOCAL_ENTRY, | 51 LOCAL_ENTRY, |
52 REMOTE_ENTRY, | 52 REMOTE_ENTRY, |
53 COMBINED_ENTRY | 53 COMBINED_ENTRY |
54 }; | 54 }; |
55 | 55 |
56 HistoryEntry(EntryType type, const GURL& url, const base::string16& title, | 56 HistoryEntry(EntryType type, const GURL& url, const base::string16& title, |
57 base::Time time, const std::string& client_id, | 57 base::Time time, const std::string& client_id, |
58 bool is_search_result, const base::string16& snippet, | 58 bool is_search_result, const base::string16& snippet, |
59 bool blocked_visit, const std::string& accept_languages); | 59 bool blocked_visit); |
60 HistoryEntry(); | 60 HistoryEntry(); |
61 HistoryEntry(const HistoryEntry& other); | 61 HistoryEntry(const HistoryEntry& other); |
62 virtual ~HistoryEntry(); | 62 virtual ~HistoryEntry(); |
63 | 63 |
64 // Formats this entry's URL and title and adds them to |result|. | 64 // Formats this entry's URL and title and adds them to |result|. |
65 void SetUrlAndTitle(base::DictionaryValue* result) const; | 65 void SetUrlAndTitle(base::DictionaryValue* result) const; |
66 | 66 |
67 // Converts the entry to a DictionaryValue to be owned by the caller. | 67 // Converts the entry to a DictionaryValue to be owned by the caller. |
68 scoped_ptr<base::DictionaryValue> ToValue( | 68 scoped_ptr<base::DictionaryValue> ToValue( |
69 bookmarks::BookmarkModel* bookmark_model, | 69 bookmarks::BookmarkModel* bookmark_model, |
(...skipping 21 matching lines...) Expand all Loading... |
91 std::set<int64_t> all_timestamps; | 91 std::set<int64_t> all_timestamps; |
92 | 92 |
93 // If true, this entry is a search result. | 93 // If true, this entry is a search result. |
94 bool is_search_result; | 94 bool is_search_result; |
95 | 95 |
96 // The entry's search snippet, if this entry is a search result. | 96 // The entry's search snippet, if this entry is a search result. |
97 base::string16 snippet; | 97 base::string16 snippet; |
98 | 98 |
99 // Whether this entry was blocked when it was attempted. | 99 // Whether this entry was blocked when it was attempted. |
100 bool blocked_visit; | 100 bool blocked_visit; |
101 | |
102 // kAcceptLanguages pref value. | |
103 std::string accept_languages; | |
104 }; | 101 }; |
105 | 102 |
106 BrowsingHistoryHandler(); | 103 BrowsingHistoryHandler(); |
107 ~BrowsingHistoryHandler() override; | 104 ~BrowsingHistoryHandler() override; |
108 | 105 |
109 // WebUIMessageHandler implementation. | 106 // WebUIMessageHandler implementation. |
110 void RegisterMessages() override; | 107 void RegisterMessages() override; |
111 | 108 |
112 // Handler for the "queryHistory" message. | 109 // Handler for the "queryHistory" message. |
113 void HandleQueryHistory(const base::ListValue* args); | 110 void HandleQueryHistory(const base::ListValue* args); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 214 |
218 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 215 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
219 history_service_observer_; | 216 history_service_observer_; |
220 | 217 |
221 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; | 218 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; |
222 | 219 |
223 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); | 220 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); |
224 }; | 221 }; |
225 | 222 |
226 #endif // CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_ | 223 #endif // CHROME_BROWSER_UI_WEBUI_BROWSING_HISTORY_HANDLER_H_ |
OLD | NEW |