| 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_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void IterateURLs( | 149 void IterateURLs( |
| 150 const scoped_refptr<visitedlink::VisitedLinkDelegate::URLEnumerator>& | 150 const scoped_refptr<visitedlink::VisitedLinkDelegate::URLEnumerator>& |
| 151 enumerator); | 151 enumerator); |
| 152 void QueryURL(const GURL& url, | 152 void QueryURL(const GURL& url, |
| 153 bool want_visits, | 153 bool want_visits, |
| 154 QueryURLResult* query_url_result); | 154 QueryURLResult* query_url_result); |
| 155 void QueryHistory(const base::string16& text_query, | 155 void QueryHistory(const base::string16& text_query, |
| 156 const QueryOptions& options, | 156 const QueryOptions& options, |
| 157 QueryResults* query_results); | 157 QueryResults* query_results); |
| 158 void QueryRedirectsFrom(scoped_refptr<QueryRedirectsRequest> request, | 158 |
| 159 const GURL& url); | 159 // Computes the most recent URL(s) that the given canonical URL has |
| 160 void QueryRedirectsTo(scoped_refptr<QueryRedirectsRequest> request, | 160 // redirected to. There may be more than one redirect in a row, so this |
| 161 const GURL& url); | 161 // function will fill the given array with the entire chain. If there are |
| 162 // no redirects for the most recent visit of the URL, or the URL is not |
| 163 // in history, the array will be empty. |
| 164 void QueryRedirectsFrom(const GURL& url, RedirectList* redirects); |
| 165 |
| 166 // Similar to above function except computes a chain of redirects to the |
| 167 // given URL. Stores the most recent list of redirects ending at |url| in the |
| 168 // given RedirectList. For example, if we have the redirect list A -> B -> C, |
| 169 // then calling this function with url=C would fill redirects with {B, A}. |
| 170 void QueryRedirectsTo(const GURL& url, RedirectList* redirects); |
| 162 | 171 |
| 163 void GetVisibleVisitCountToHost( | 172 void GetVisibleVisitCountToHost( |
| 164 scoped_refptr<GetVisibleVisitCountToHostRequest> request, | 173 scoped_refptr<GetVisibleVisitCountToHostRequest> request, |
| 165 const GURL& url); | 174 const GURL& url); |
| 166 | 175 |
| 167 // TODO(Nik): remove. Use QueryMostVisitedURLs instead. | 176 // TODO(Nik): remove. Use QueryMostVisitedURLs instead. |
| 168 void QueryTopURLsAndRedirects( | 177 void QueryTopURLsAndRedirects( |
| 169 scoped_refptr<QueryTopURLsAndRedirectsRequest> request, | 178 scoped_refptr<QueryTopURLsAndRedirectsRequest> request, |
| 170 int result_count); | 179 int result_count); |
| 171 | 180 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 184 scoped_refptr<QueryFilteredURLsRequest> request, | 193 scoped_refptr<QueryFilteredURLsRequest> request, |
| 185 int result_count, | 194 int result_count, |
| 186 const history::VisitFilter& filter, | 195 const history::VisitFilter& filter, |
| 187 bool debug); | 196 bool debug); |
| 188 | 197 |
| 189 // QueryMostVisitedURLs without the request. | 198 // QueryMostVisitedURLs without the request. |
| 190 void QueryMostVisitedURLsImpl(int result_count, | 199 void QueryMostVisitedURLsImpl(int result_count, |
| 191 int days_back, | 200 int days_back, |
| 192 MostVisitedURLList* result); | 201 MostVisitedURLList* result); |
| 193 | 202 |
| 194 // Computes the most recent URL(s) that the given canonical URL has | |
| 195 // redirected to and returns true on success. There may be more than one | |
| 196 // redirect in a row, so this function will fill the given array with the | |
| 197 // entire chain. If there are no redirects for the most recent visit of the | |
| 198 // URL, or the URL is not in history, returns false. | |
| 199 // | |
| 200 // Backend for QueryRedirectsFrom. | |
| 201 bool GetMostRecentRedirectsFrom(const GURL& url, | |
| 202 history::RedirectList* redirects); | |
| 203 | |
| 204 // Similar to above function except computes a chain of redirects to the | |
| 205 // given URL. Stores the most recent list of redirects ending at |url| in the | |
| 206 // given RedirectList. For example, if we have the redirect list A -> B -> C, | |
| 207 // then calling this function with url=C would fill redirects with {B, A}. | |
| 208 bool GetMostRecentRedirectsTo(const GURL& url, | |
| 209 history::RedirectList* redirects); | |
| 210 | |
| 211 // Favicon ------------------------------------------------------------------- | 203 // Favicon ------------------------------------------------------------------- |
| 212 | 204 |
| 213 void GetFavicons( | 205 void GetFavicons( |
| 214 const std::vector<GURL>& icon_urls, | 206 const std::vector<GURL>& icon_urls, |
| 215 int icon_types, | 207 int icon_types, |
| 216 const std::vector<int>& desired_sizes, | 208 const std::vector<int>& desired_sizes, |
| 217 std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results); | 209 std::vector<favicon_base::FaviconRawBitmapResult>* bitmap_results); |
| 218 | 210 |
| 219 void GetLargestFaviconForURL( | 211 void GetLargestFaviconForURL( |
| 220 const GURL& page_url, | 212 const GURL& page_url, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 861 |
| 870 // Listens for the system being under memory pressure. | 862 // Listens for the system being under memory pressure. |
| 871 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 863 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 872 | 864 |
| 873 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 865 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 874 }; | 866 }; |
| 875 | 867 |
| 876 } // namespace history | 868 } // namespace history |
| 877 | 869 |
| 878 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 870 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |