- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / favicon / favicon_handler_delegate.h
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.
4
5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_
7
8 class GURL;
9
10 namespace content {
11 class NavigationEntry;
12 }
13
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
16 // about changes.
17 class FaviconHandlerDelegate {
18  public:
19   // Returns the current NavigationEntry.
20   virtual content::NavigationEntry* GetActiveEntry() = 0;
21
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;
31
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;
36 };
37
38 #endif  // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_DELEGATE_H_