Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1734)

Unified Diff: chrome/browser/favicon/favicon_tab_helper.h

Issue 11195010: Extract Favicon Download logic from FaviconTabHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/favicon/favicon_tab_helper.h
diff --git a/chrome/browser/favicon/favicon_tab_helper.h b/chrome/browser/favicon/favicon_tab_helper.h
index d8e0750a5fb10523df8ed28fd95f41c82605e5ac..70e371cd7042bac9e3ea551bd8a257fe3613d564 100644
--- a/chrome/browser/favicon/favicon_tab_helper.h
+++ b/chrome/browser/favicon/favicon_tab_helper.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "chrome/browser/favicon/favicon_download_helper_delegate.h"
#include "chrome/browser/favicon/favicon_handler_delegate.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/common/favicon_url.h"
@@ -20,6 +21,7 @@ class Image;
}
class GURL;
+class FaviconDownloadHelper;
class FaviconHandler;
class Profile;
class SkBitmap;
@@ -35,6 +37,7 @@ class SkBitmap;
//
class FaviconTabHelper : public content::WebContentsObserver,
public FaviconHandlerDelegate,
+ public FaviconDownloadHelperDelegate,
public content::WebContentsUserData<FaviconTabHelper> {
public:
virtual ~FaviconTabHelper();
@@ -55,6 +58,11 @@ class FaviconTabHelper : public content::WebContentsObserver,
// space is provided for the favicon, and the favicon is never displayed.
virtual bool ShouldDisplayFavicon();
+ // Message Handler. Must be public, because also called from
+ // PrerenderContents.
+ virtual void OnUpdateFaviconURL(int32 page_id,
+ const std::vector<FaviconURL>& candidates) OVERRIDE;
+
// Saves the favicon for the current page.
void SaveFavicon();
@@ -72,11 +80,6 @@ class FaviconTabHelper : public content::WebContentsObserver,
history::IconType icon_type,
const ImageDownloadCallback& callback);
- // Message Handler. Must be public, because also called from
- // PrerenderContents.
- void OnUpdateFaviconURL(int32 page_id,
- const std::vector<FaviconURL>& candidates);
-
// FaviconHandlerDelegate methods.
virtual content::NavigationEntry* GetActiveEntry() OVERRIDE;
virtual int StartDownload(const GURL& url, int image_size) OVERRIDE;
@@ -93,17 +96,19 @@ class FaviconTabHelper : public content::WebContentsObserver,
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- // Message handler for IconHostMsg_DidDownloadFavicon.
- void OnDidDownloadFavicon(int id,
- const GURL& image_url,
- bool errored,
- int requested_size,
- const std::vector<SkBitmap>& bitmaps);
+ // FaviconDownloadHelperDelegate overrides.
+ virtual void OnDidDownloadFavicon(
+ int id,
+ const GURL& image_url,
+ bool errored,
+ int requested_size,
+ const std::vector<SkBitmap>& bitmaps) OVERRIDE;
Profile* profile_;
+ scoped_ptr<FaviconDownloadHelper> favicon_download_helper_;
+
scoped_ptr<FaviconHandler> favicon_handler_;
// Handles downloading touchicons. It is NULL if

Powered by Google App Engine
This is Rietveld 408576698