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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 private: | 218 private: |
219 typedef uint32 MissingFaviconURLHash; | 219 typedef uint32 MissingFaviconURLHash; |
220 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; | 220 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; |
221 HistoryService* history_service_; | 221 HistoryService* history_service_; |
222 Profile* profile_; | 222 Profile* profile_; |
223 | 223 |
224 // Helper function for GetFaviconImageForPageURL(), GetRawFaviconForPageURL() | 224 // Helper function for GetFaviconImageForPageURL(), GetRawFaviconForPageURL() |
225 // and GetFaviconForPageURL(). | 225 // and GetFaviconForPageURL(). |
226 base::CancelableTaskTracker::TaskId GetFaviconForPageURLImpl( | 226 base::CancelableTaskTracker::TaskId GetFaviconForPageURLImpl( |
227 const FaviconForPageURLParams& params, | 227 const FaviconForPageURLParams& params, |
228 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 228 const std::vector<int>& desired_sizes_in_pixel, |
229 const favicon_base::FaviconResultsCallback& callback, | 229 const favicon_base::FaviconResultsCallback& callback, |
230 base::CancelableTaskTracker* tracker); | 230 base::CancelableTaskTracker* tracker); |
231 | 231 |
232 // Intermediate callback for GetFaviconImage() and GetFaviconImageForPageURL() | 232 // Intermediate callback for GetFaviconImage() and GetFaviconImageForPageURL() |
233 // so that history service can deal solely with FaviconResultsCallback. | 233 // so that history service can deal solely with FaviconResultsCallback. |
234 // Builds favicon_base::FaviconImageResult from |favicon_bitmap_results| and | 234 // Builds favicon_base::FaviconImageResult from |favicon_bitmap_results| and |
235 // runs |callback|. | 235 // runs |callback|. |
236 void RunFaviconImageCallbackWithBitmapResults( | 236 void RunFaviconImageCallbackWithBitmapResults( |
237 const favicon_base::FaviconImageCallback& callback, | 237 const favicon_base::FaviconImageCallback& callback, |
238 int desired_size_in_dip, | 238 int desired_size_in_dip, |
239 const std::vector<favicon_base::FaviconRawBitmapResult>& | 239 const std::vector<favicon_base::FaviconRawBitmapResult>& |
240 favicon_bitmap_results); | 240 favicon_bitmap_results); |
241 | 241 |
242 // Intermediate callback for GetRawFavicon() and GetRawFaviconForPageURL() | 242 // Intermediate callback for GetRawFavicon() and GetRawFaviconForPageURL() |
243 // so that history service can deal solely with FaviconResultsCallback. | 243 // so that history service can deal solely with FaviconResultsCallback. |
244 // Resizes favicon_base::FaviconRawBitmapResult if necessary and runs | 244 // Resizes favicon_base::FaviconRawBitmapResult if necessary and runs |
245 // |callback|. | 245 // |callback|. |
246 void RunFaviconRawBitmapCallbackWithBitmapResults( | 246 void RunFaviconRawBitmapCallbackWithBitmapResults( |
247 const favicon_base::FaviconRawBitmapCallback& callback, | 247 const favicon_base::FaviconRawBitmapCallback& callback, |
248 int desired_size_in_dip, | 248 int desired_size_in_pixel, |
249 ui::ScaleFactor desired_scale_factor, | |
250 const std::vector<favicon_base::FaviconRawBitmapResult>& | 249 const std::vector<favicon_base::FaviconRawBitmapResult>& |
251 favicon_bitmap_results); | 250 favicon_bitmap_results); |
252 | 251 |
253 DISALLOW_COPY_AND_ASSIGN(FaviconService); | 252 DISALLOW_COPY_AND_ASSIGN(FaviconService); |
254 }; | 253 }; |
255 | 254 |
256 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 255 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
OLD | NEW |