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_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // Queries all history with the given options (see QueryOptions in | 267 // Queries all history with the given options (see QueryOptions in |
268 // history_types.h). If empty, all results matching the given options | 268 // history_types.h). If empty, all results matching the given options |
269 // will be returned. | 269 // will be returned. |
270 Handle QueryHistory(const base::string16& text_query, | 270 Handle QueryHistory(const base::string16& text_query, |
271 const history::QueryOptions& options, | 271 const history::QueryOptions& options, |
272 CancelableRequestConsumerBase* consumer, | 272 CancelableRequestConsumerBase* consumer, |
273 const QueryHistoryCallback& callback); | 273 const QueryHistoryCallback& callback); |
274 | 274 |
275 // Called when the results of QueryRedirectsFrom are available. | 275 // Called when the results of QueryRedirectsFrom are available. |
276 // The given vector will contain a list of all redirects, not counting | 276 // The given vector will contain a list of all redirects, not counting |
277 // the original page. If A redirects to B, the vector will contain only B, | 277 // the original page. If A redirects to B which redirects to C, the vector |
278 // and A will be in 'source_url'. | 278 // will contain [B, C], and A will be in 'from_url'. |
| 279 // |
| 280 // For QueryRedirectsTo, the order is reversed. For A->B->C, the vector will |
| 281 // contain [B, A] and C will be in 'to_url'. |
279 // | 282 // |
280 // If there is no such URL in the database or the most recent visit has no | 283 // If there is no such URL in the database or the most recent visit has no |
281 // redirect, the vector will be empty. If the history system failed for | 284 // redirect, the vector will be empty. If the history system failed for |
282 // some reason, success will additionally be false. If the given page | 285 // some reason, success will additionally be false. If the given page |
283 // has redirected to multiple destinations, this will pick a random one. | 286 // has redirected to multiple destinations, this will pick a random one. |
284 typedef base::Callback<void(Handle, | 287 typedef base::Callback<void(Handle, |
285 GURL, // from_url | 288 GURL, // from_url / to_url |
286 bool, // success | 289 bool, // success |
287 history::RedirectList*)> QueryRedirectsCallback; | 290 history::RedirectList*)> QueryRedirectsCallback; |
288 | 291 |
289 // Schedules a query for the most recent redirect coming out of the given | 292 // Schedules a query for the most recent redirect coming out of the given |
290 // URL. See the RedirectQuerySource above, which is guaranteed to be called | 293 // URL. See the RedirectQuerySource above, which is guaranteed to be called |
291 // if the request is not canceled. | 294 // if the request is not canceled. |
292 Handle QueryRedirectsFrom(const GURL& from_url, | 295 Handle QueryRedirectsFrom(const GURL& from_url, |
293 CancelableRequestConsumerBase* consumer, | 296 CancelableRequestConsumerBase* consumer, |
294 const QueryRedirectsCallback& callback); | 297 const QueryRedirectsCallback& callback); |
295 | 298 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1067 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1065 | 1068 |
1066 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1069 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
1067 | 1070 |
1068 history::DeleteDirectiveHandler delete_directive_handler_; | 1071 history::DeleteDirectiveHandler delete_directive_handler_; |
1069 | 1072 |
1070 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1073 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1071 }; | 1074 }; |
1072 | 1075 |
1073 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 1076 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |