| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_DELEGATE_H_ | |
| 6 #define COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_DELEGATE_H_ | |
| 7 | |
| 8 class GURL; | |
| 9 | |
| 10 namespace content { | |
| 11 // TODO(jif): Abstract the NavigationEntry (crbug.com/359598). | |
| 12 class NavigationEntry; | |
| 13 } | |
| 14 | |
| 15 // This class provides a delegate interface for a FaviconHandler. It allows the | |
| 16 // FaviconHandler to ask its delegate for information or notify its delegate | |
| 17 // about changes. | |
| 18 class FaviconHandlerDelegate { | |
| 19 public: | |
| 20 // Returns the current NavigationEntry. | |
| 21 // TODO(jif): Abstract the NavigationEntry (crbug.com/359598). | |
| 22 virtual content::NavigationEntry* GetActiveEntry() = 0; | |
| 23 | |
| 24 // Starts the download for the given favicon. When finished, the delegate | |
| 25 // will call OnDidDownloadFavicon() with the results. | |
| 26 // Returns the unique id of the download request. The id will be passed | |
| 27 // in OnDidDownloadFavicon(). | |
| 28 // Bitmaps with pixel sizes larger than |max_bitmap_size| are filtered out | |
| 29 // from the bitmap results. If there are no bitmap results <= | |
| 30 // |max_bitmap_size|, the smallest bitmap is resized to |max_bitmap_size| and | |
| 31 // is the only result. A |max_bitmap_size| of 0 means unlimited. | |
| 32 virtual int StartDownload(const GURL& url, int max_bitmap_size) = 0; | |
| 33 | |
| 34 // Notifies the delegate that the favicon for the active entry was updated. | |
| 35 // |icon_url_changed| is true if a favicon with a different icon URL has | |
| 36 // been selected since the previous call to NotifyFaviconUpdated(). | |
| 37 virtual void NotifyFaviconUpdated(bool icon_url_changed) = 0; | |
| 38 | |
| 39 // Returns whether the user is operating in an off-the-record context. | |
| 40 virtual bool IsOffTheRecord() = 0; | |
| 41 }; | |
| 42 | |
| 43 #endif // COMPONENTS_FAVICON_CORE_FAVICON_HANDLER_DELEGATE_H_ | |
| OLD | NEW |