| 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 COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| 6 #define COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 6 #define COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 int max_image_size, | 116 int max_image_size, |
| 117 ImageDownloadCallback callback) = 0; | 117 ImageDownloadCallback callback) = 0; |
| 118 | 118 |
| 119 // Downloads a WebManifest and returns the favicons listed there. | 119 // Downloads a WebManifest and returns the favicons listed there. |
| 120 virtual void DownloadManifest(const GURL& url, | 120 virtual void DownloadManifest(const GURL& url, |
| 121 ManifestDownloadCallback callback) = 0; | 121 ManifestDownloadCallback callback) = 0; |
| 122 | 122 |
| 123 // Returns whether the user is operating in an off-the-record context. | 123 // Returns whether the user is operating in an off-the-record context. |
| 124 virtual bool IsOffTheRecord() = 0; | 124 virtual bool IsOffTheRecord() = 0; |
| 125 | 125 |
| 126 // Returns whether |url| is bookmarked. | |
| 127 virtual bool IsBookmarked(const GURL& url) = 0; | |
| 128 | |
| 129 // Notifies that the favicon image has been updated. Most delegates | 126 // Notifies that the favicon image has been updated. Most delegates |
| 130 // propagate the notification to FaviconDriverObserver::OnFaviconUpdated(). | 127 // propagate the notification to FaviconDriverObserver::OnFaviconUpdated(). |
| 131 // See its documentation for details. | 128 // See its documentation for details. |
| 132 virtual void OnFaviconUpdated( | 129 virtual void OnFaviconUpdated( |
| 133 const GURL& page_url, | 130 const GURL& page_url, |
| 134 FaviconDriverObserver::NotificationIconType notification_icon_type, | 131 FaviconDriverObserver::NotificationIconType notification_icon_type, |
| 135 const GURL& icon_url, | 132 const GURL& icon_url, |
| 136 bool icon_url_changed, | 133 bool icon_url_changed, |
| 137 const gfx::Image& image) = 0; | 134 const gfx::Image& image) = 0; |
| 138 }; | 135 }; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 243 |
| 247 // Triggered when a download of an image has finished. | 244 // Triggered when a download of an image has finished. |
| 248 void OnDidDownloadFavicon( | 245 void OnDidDownloadFavicon( |
| 249 favicon_base::IconType icon_type, | 246 favicon_base::IconType icon_type, |
| 250 int id, | 247 int id, |
| 251 int http_status_code, | 248 int http_status_code, |
| 252 const GURL& image_url, | 249 const GURL& image_url, |
| 253 const std::vector<SkBitmap>& bitmaps, | 250 const std::vector<SkBitmap>& bitmaps, |
| 254 const std::vector<gfx::Size>& original_bitmap_sizes); | 251 const std::vector<gfx::Size>& original_bitmap_sizes); |
| 255 | 252 |
| 256 bool ShouldSaveFavicon(const GURL& page_url) const; | |
| 257 | |
| 258 // Updates |best_favicon_| and returns true if it was considered a satisfying | 253 // Updates |best_favicon_| and returns true if it was considered a satisfying |
| 259 // image (e.g. exact size match). | 254 // image (e.g. exact size match). |
| 260 bool UpdateFaviconCandidate(const DownloadedFavicon& downloaded_favicon); | 255 bool UpdateFaviconCandidate(const DownloadedFavicon& downloaded_favicon); |
| 261 | 256 |
| 262 // Sets the image data for the favicon. | 257 // Sets the image data for the favicon. |
| 263 void SetFavicon(const GURL& icon_url, | 258 void SetFavicon(const GURL& icon_url, |
| 264 const gfx::Image& image, | 259 const gfx::Image& image, |
| 265 favicon_base::IconType icon_type); | 260 favicon_base::IconType icon_type); |
| 266 | 261 |
| 267 // Notifies |driver_| that FaviconHandler found an icon which matches the | 262 // Notifies |driver_| that FaviconHandler found an icon which matches the |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // UpdateFaviconCandidate()), the favicon service and the delegate are | 369 // UpdateFaviconCandidate()), the favicon service and the delegate are |
| 375 // notified. | 370 // notified. |
| 376 DownloadedFavicon best_favicon_; | 371 DownloadedFavicon best_favicon_; |
| 377 | 372 |
| 378 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); | 373 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); |
| 379 }; | 374 }; |
| 380 | 375 |
| 381 } // namespace favicon | 376 } // namespace favicon |
| 382 | 377 |
| 383 #endif // COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ | 378 #endif // COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_H_ |
| OLD | NEW |