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_FAVICON_FAVICON_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 const FaviconForURLParams& params, | 165 const FaviconForURLParams& params, |
166 const FaviconImageCallback& callback, | 166 const FaviconImageCallback& callback, |
167 CancelableTaskTracker* tracker); | 167 CancelableTaskTracker* tracker); |
168 | 168 |
169 CancelableTaskTracker::TaskId GetRawFaviconForURL( | 169 CancelableTaskTracker::TaskId GetRawFaviconForURL( |
170 const FaviconForURLParams& params, | 170 const FaviconForURLParams& params, |
171 ui::ScaleFactor desired_scale_factor, | 171 ui::ScaleFactor desired_scale_factor, |
172 const FaviconRawCallback& callback, | 172 const FaviconRawCallback& callback, |
173 CancelableTaskTracker* tracker); | 173 CancelableTaskTracker* tracker); |
174 | 174 |
| 175 // See history::HistoryService::GetLargestFaviconForURL. |
| 176 CancelableTaskTracker::TaskId GetLargestRawFaviconForURL( |
| 177 Profile* profile, |
| 178 const GURL& page_url, |
| 179 const std::vector<int>& icon_types, |
| 180 int minimal_size_in_pixels, |
| 181 const FaviconRawCallback& callback, |
| 182 CancelableTaskTracker* tracker); |
| 183 |
175 CancelableTaskTracker::TaskId GetFaviconForURL( | 184 CancelableTaskTracker::TaskId GetFaviconForURL( |
176 const FaviconForURLParams& params, | 185 const FaviconForURLParams& params, |
177 const FaviconResultsCallback& callback, | 186 const FaviconResultsCallback& callback, |
178 CancelableTaskTracker* tracker); | 187 CancelableTaskTracker* tracker); |
179 | 188 |
180 // Used to request a bitmap for the favicon with |favicon_id| which is not | 189 // Used to request a bitmap for the favicon with |favicon_id| which is not |
181 // resized from the size it is stored at in the database. If there are | 190 // resized from the size it is stored at in the database. If there are |
182 // multiple favicon bitmaps for |favicon_id|, the largest favicon bitmap is | 191 // multiple favicon bitmaps for |favicon_id|, the largest favicon bitmap is |
183 // returned. | 192 // returned. |
184 CancelableTaskTracker::TaskId GetLargestRawFaviconForID( | 193 CancelableTaskTracker::TaskId GetLargestRawFaviconForID( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 HistoryService* history_service_; | 248 HistoryService* history_service_; |
240 | 249 |
241 // Helper function for GetFaviconImageForURL(), GetRawFaviconForURL() and | 250 // Helper function for GetFaviconImageForURL(), GetRawFaviconForURL() and |
242 // GetFaviconForURL(). | 251 // GetFaviconForURL(). |
243 CancelableTaskTracker::TaskId GetFaviconForURLImpl( | 252 CancelableTaskTracker::TaskId GetFaviconForURLImpl( |
244 const FaviconForURLParams& params, | 253 const FaviconForURLParams& params, |
245 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 254 const std::vector<ui::ScaleFactor>& desired_scale_factors, |
246 const FaviconResultsCallback& callback, | 255 const FaviconResultsCallback& callback, |
247 CancelableTaskTracker* tracker); | 256 CancelableTaskTracker* tracker); |
248 | 257 |
| 258 CancelableTaskTracker::TaskId GetLargestRawFaviconForURLImpl( |
| 259 Profile* profile, |
| 260 const GURL& page_url, |
| 261 const std::vector<int>& icon_types, |
| 262 int minimal_size_in_pixels, |
| 263 const FaviconResultsCallback& callback, |
| 264 CancelableTaskTracker* tracker); |
| 265 |
249 // Intermediate callback for GetFaviconImage() and GetFaviconImageForURL() | 266 // Intermediate callback for GetFaviconImage() and GetFaviconImageForURL() |
250 // so that history service can deal solely with FaviconResultsCallback. | 267 // so that history service can deal solely with FaviconResultsCallback. |
251 // Builds chrome::FaviconImageResult from |favicon_bitmap_results| and runs | 268 // Builds chrome::FaviconImageResult from |favicon_bitmap_results| and runs |
252 // |callback|. | 269 // |callback|. |
253 void RunFaviconImageCallbackWithBitmapResults( | 270 void RunFaviconImageCallbackWithBitmapResults( |
254 const FaviconImageCallback& callback, | 271 const FaviconImageCallback& callback, |
255 int desired_size_in_dip, | 272 int desired_size_in_dip, |
256 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); | 273 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); |
257 | 274 |
258 // Intermediate callback for GetRawFavicon() and GetRawFaviconForURL() | 275 // Intermediate callback for GetRawFavicon() and GetRawFaviconForURL() |
259 // so that history service can deal solely with FaviconResultsCallback. | 276 // so that history service can deal solely with FaviconResultsCallback. |
260 // Resizes chrome::FaviconBitmapResult if necessary and runs |callback|. | 277 // Resizes chrome::FaviconBitmapResult if necessary and runs |callback|. |
261 void RunFaviconRawCallbackWithBitmapResults( | 278 void RunFaviconRawCallbackWithBitmapResults( |
262 const FaviconRawCallback& callback, | 279 const FaviconRawCallback& callback, |
263 int desired_size_in_dip, | 280 int desired_size_in_dip, |
264 ui::ScaleFactor desired_scale_factor, | 281 ui::ScaleFactor desired_scale_factor, |
265 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); | 282 const std::vector<chrome::FaviconBitmapResult>& favicon_bitmap_results); |
266 | 283 |
267 DISALLOW_COPY_AND_ASSIGN(FaviconService); | 284 DISALLOW_COPY_AND_ASSIGN(FaviconService); |
268 }; | 285 }; |
269 | 286 |
270 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 287 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
OLD | NEW |