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_HISTORY_WEB_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Callback with the result of a call to QueryHistory(). Currently, the | 45 // Callback with the result of a call to QueryHistory(). Currently, the |
46 // DictionaryValue is just the parsed JSON response from the server. | 46 // DictionaryValue is just the parsed JSON response from the server. |
47 // TODO(dubroy): Extract the DictionaryValue into a structured results object. | 47 // TODO(dubroy): Extract the DictionaryValue into a structured results object. |
48 typedef base::Callback<void(Request*, const base::DictionaryValue*)> | 48 typedef base::Callback<void(Request*, const base::DictionaryValue*)> |
49 QueryWebHistoryCallback; | 49 QueryWebHistoryCallback; |
50 | 50 |
51 typedef base::Callback<void(bool success)> ExpireWebHistoryCallback; | 51 typedef base::Callback<void(bool success)> ExpireWebHistoryCallback; |
52 | 52 |
53 explicit WebHistoryService(Profile* profile); | 53 explicit WebHistoryService(Profile* profile); |
54 virtual ~WebHistoryService(); | 54 ~WebHistoryService() override; |
55 | 55 |
56 // Searches synced history for visits matching |text_query|. The timeframe to | 56 // Searches synced history for visits matching |text_query|. The timeframe to |
57 // search, along with other options, is specified in |options|. If | 57 // search, along with other options, is specified in |options|. If |
58 // |text_query| is empty, all visits in the timeframe will be returned. | 58 // |text_query| is empty, all visits in the timeframe will be returned. |
59 // This method is the equivalent of HistoryService::QueryHistory. | 59 // This method is the equivalent of HistoryService::QueryHistory. |
60 // The caller takes ownership of the returned Request. If it is destroyed, the | 60 // The caller takes ownership of the returned Request. If it is destroyed, the |
61 // request is cancelled. | 61 // request is cancelled. |
62 scoped_ptr<Request> QueryHistory( | 62 scoped_ptr<Request> QueryHistory( |
63 const base::string16& text_query, | 63 const base::string16& text_query, |
64 const QueryOptions& options, | 64 const QueryOptions& options, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 std::set<Request*> pending_expire_requests_; | 105 std::set<Request*> pending_expire_requests_; |
106 | 106 |
107 base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_; | 107 base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(WebHistoryService); | 109 DISALLOW_COPY_AND_ASSIGN(WebHistoryService); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace history | 112 } // namespace history |
113 | 113 |
114 #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ | 114 #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
OLD | NEW |