| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ |
| 6 #define COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ | 6 #define COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // supported by the platform (e.g. MacOS). If data is unavailable for some or | 81 // supported by the platform (e.g. MacOS). If data is unavailable for some or |
| 82 // all of the scale factors, the bitmaps with the best matching sizes are | 82 // all of the scale factors, the bitmaps with the best matching sizes are |
| 83 // resized. | 83 // resized. |
| 84 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForPageURL( | 84 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForPageURL( |
| 85 const GURL& page_url, | 85 const GURL& page_url, |
| 86 const favicon_base::FaviconImageCallback& callback, | 86 const favicon_base::FaviconImageCallback& callback, |
| 87 base::CancelableTaskTracker* tracker) = 0; | 87 base::CancelableTaskTracker* tracker) = 0; |
| 88 | 88 |
| 89 // Requests the favicon for the page at |page_url| with one of |icon_types| | 89 // Requests the favicon for the page at |page_url| with one of |icon_types| |
| 90 // and with |desired_size_in_pixel|. |icon_types| can be any combination of | 90 // and with |desired_size_in_pixel|. |icon_types| can be any combination of |
| 91 // IconTypes. If favicon bitmaps for several IconTypes are available, the | 91 // IconTypes. If there is no favicon bitmap of size |desired_size_in_pixel|, |
| 92 // favicon bitmap is chosen in the priority of TOUCH_PRECOMPOSED_ICON, | 92 // the favicon bitmap which best matches |desired_size_in_pixel| is resized. |
| 93 // TOUCH_ICON and FAVICON. If there is no favicon bitmap of size | 93 // If |desired_size_in_pixel| is 0, the largest favicon bitmap is returned. |
| 94 // |desired_size_in_pixel|, the favicon bitmap which best matches | |
| 95 // |desired_size_in_pixel| is resized. If |desired_size_in_pixel| is 0, | |
| 96 // the largest favicon bitmap is returned. Results with a higher priority | |
| 97 // IconType are preferred over an exact match of the favicon bitmap size. | |
| 98 virtual base::CancelableTaskTracker::TaskId GetRawFaviconForPageURL( | 94 virtual base::CancelableTaskTracker::TaskId GetRawFaviconForPageURL( |
| 99 const GURL& page_url, | 95 const GURL& page_url, |
| 100 int icon_types, | 96 int icon_types, |
| 101 int desired_size_in_pixel, | 97 int desired_size_in_pixel, |
| 102 const favicon_base::FaviconRawBitmapCallback& callback, | 98 const favicon_base::FaviconRawBitmapCallback& callback, |
| 103 base::CancelableTaskTracker* tracker) = 0; | 99 base::CancelableTaskTracker* tracker) = 0; |
| 104 | 100 |
| 105 // See HistoryService::GetLargestFaviconForPageURL(). | 101 // See HistoryService::GetLargestFaviconForPageURL(). |
| 106 virtual base::CancelableTaskTracker::TaskId GetLargestRawFaviconForPageURL( | 102 virtual base::CancelableTaskTracker::TaskId GetLargestRawFaviconForPageURL( |
| 107 const GURL& page_url, | 103 const GURL& page_url, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 187 |
| 192 // Avoid repeated requests to download missing favicon. | 188 // Avoid repeated requests to download missing favicon. |
| 193 virtual void UnableToDownloadFavicon(const GURL& icon_url) = 0; | 189 virtual void UnableToDownloadFavicon(const GURL& icon_url) = 0; |
| 194 virtual bool WasUnableToDownloadFavicon(const GURL& icon_url) const = 0; | 190 virtual bool WasUnableToDownloadFavicon(const GURL& icon_url) const = 0; |
| 195 virtual void ClearUnableToDownloadFavicons() = 0; | 191 virtual void ClearUnableToDownloadFavicons() = 0; |
| 196 }; | 192 }; |
| 197 | 193 |
| 198 } // namespace favicon | 194 } // namespace favicon |
| 199 | 195 |
| 200 #endif // COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ | 196 #endif // COMPONENTS_FAVICON_CORE_FAVICON_SERVICE_H_ |
| OLD | NEW |