Chromium Code Reviews| Index: chrome/browser/favicon/favicon_handler.h |
| diff --git a/chrome/browser/favicon/favicon_handler.h b/chrome/browser/favicon/favicon_handler.h |
| index 6cb9d5913a8ea1ae610873071b76f1c0e43d0db0..021aeeb0f4286b4fa108faf9f421a82106d15e36 100644 |
| --- a/chrome/browser/favicon/favicon_handler.h |
| +++ b/chrome/browser/favicon/favicon_handler.h |
| @@ -28,11 +28,7 @@ namespace base { |
| class RefCountedMemory; |
| } |
| -namespace content { |
| -class NavigationEntry; |
| -} |
| - |
| -// FaviconHandler works with FaviconTabHelper to fetch the specific type of |
| +// FaviconHandler works with FaviconDriver to fetch the specific type of |
| // favicon. |
| // |
| // FetchFavicon requests the favicon from the favicon service which in turn |
| @@ -40,7 +36,7 @@ class NavigationEntry; |
| // we only know the URL of the page, and not necessarily the url of the |
| // favicon. To ensure we handle reloading stale favicons as well as |
| // reloading a favicon on page reload we always request the favicon from |
| -// history regardless of whether the NavigationEntry has a favicon. |
| +// history regardless of whether the active favicon is valid. |
| // |
| // After the navigation two types of events are delivered (which is |
| // first depends upon who is faster): notification from the history |
| @@ -54,7 +50,7 @@ class NavigationEntry; |
| // ok). |
| // . On the other hand if the database does not know the favicon for url, or |
| // the favicon is out date, or the URL from the renderer does not match that |
| -// NavigationEntry we proceed to DownloadFaviconOrAskHistory. Before we |
| +// of the current page we proceed to DownloadFaviconOrAskHistory. Before we |
| // invoke DownloadFaviconOrAskHistory we wait until we've received both |
| // the favicon url and the callback from history. We wait to ensure we |
| // truly know both the favicon url and the state of the database. |
| @@ -76,8 +72,7 @@ class NavigationEntry; |
| // favicon will be used, otherwise the one that best matches the preferred size |
| // is chosen (or the first one if there is no preferred size). Once the |
| // matching favicon has been determined, SetFavicon is called which updates |
| -// the favicon of the NavigationEntry and notifies the database to save the |
| -// favicon. |
| +// the page's favicon and notifies the database to save the favicon. |
| class FaviconHandler { |
| public: |
| @@ -123,10 +118,6 @@ class FaviconHandler { |
| // These virtual methods make FaviconHandler testable and are overridden by |
| // TestFaviconHandler. |
| - // Return the NavigationEntry for the active entry, or NULL if the active |
| - // entries URL does not match that of the URL last passed to FetchFavicon. |
| - virtual content::NavigationEntry* GetEntry(); |
| - |
| // Asks the render to download favicon, returns the request id. |
| virtual int DownloadFavicon(const GURL& image_url, int max_bitmap_size); |
| @@ -232,21 +223,19 @@ class FaviconHandler { |
| const gfx::Image& image, |
| favicon_base::IconType icon_type); |
| - // Sets the favicon's data on the NavigationEntry. |
| - // If the WebContents has a delegate, it is invalidated (INVALIDATE_TYPE_TAB). |
| - void SetFaviconOnNavigationEntry( |
| - content::NavigationEntry* entry, |
| - const std::vector<favicon_base::FaviconBitmapResult>& |
| - favicon_bitmap_results); |
| - void SetFaviconOnNavigationEntry(content::NavigationEntry* entry, |
| - const GURL& icon_url, |
| - const gfx::Image& image); |
| + // Sets the favicon's data. |
| + void SetFaviconOnActivePage(const std::vector< |
| + favicon_base::FaviconBitmapResult>& favicon_bitmap_results); |
| + void SetFaviconOnActivePage(const GURL& icon_url, const gfx::Image& image); |
| // Return the current candidate if any. |
| content::FaviconURL* current_candidate() { |
| return (!image_urls_.empty()) ? &image_urls_.front() : NULL; |
| } |
| + // Returns wheter the page's url changed since the favicon was requested. |
|
blundell
2014/05/12 07:52:19
s/wheter/whether
jif
2014/05/12 18:07:41
Done.
|
| + bool PageChangedSinceFaviconWasRequested(); |
| + |
| // Returns the preferred size of the image. 0 means no preference (any size |
| // will do). |
| int preferred_icon_size() const { |