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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_
11 class NavigationEntry
;
14 // This class provides a delegate interface for a FaviconHandler. It allows the
15 // FaviconHandler to ask its delegate for information or notify its delegate
17 class FaviconHandlerDelegate
{
19 // Returns the current NavigationEntry.
20 virtual content::NavigationEntry
* GetActiveEntry() = 0;
22 // Starts the download for the given favicon. When finished, the delegate
23 // will call OnDidDownloadFavicon() with the results.
24 // Returns the unique id of the download request. The id will be passed
25 // in OnDidDownloadFavicon().
26 // Bitmaps with pixel sizes larger than |max_bitmap_size| are filtered out
27 // from the bitmap results. If there are no bitmap results <=
28 // |max_bitmap_size|, the smallest bitmap is resized to |max_bitmap_size| and
29 // is the only result. A |max_bitmap_size| of 0 means unlimited.
30 virtual int StartDownload(const GURL
& url
, int max_bitmap_size
) = 0;
32 // Notifies the delegate that the favicon for the active entry was updated.
33 // |icon_url_changed| is true if a favicon with a different icon URL has
34 // been selected since the previous call to NotifyFaviconUpdated().
35 virtual void NotifyFaviconUpdated(bool icon_url_changed
) = 0;
38 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_