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

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

Issue 9696057: Prioritize smaller favicons over larger ones for tabs, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease clang Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_handler.h
diff --git a/chrome/browser/favicon/favicon_handler.h b/chrome/browser/favicon/favicon_handler.h
index a59e944c42e6e66b7ba81b97b05851c1de1c8a01..4b48e5288d1f4ec897cac624a9ec148b7d6f5f8e 100644
--- a/chrome/browser/favicon/favicon_handler.h
+++ b/chrome/browser/favicon/favicon_handler.h
@@ -18,6 +18,7 @@
#include "chrome/common/ref_counted_util.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/favicon_size.h"
+#include "ui/gfx/image/image.h"
class FaviconHandlerDelegate;
class Profile;
@@ -29,10 +30,6 @@ namespace content {
class NavigationEntry;
}
-namespace gfx {
-class Image;
-}
-
// FaviconHandler works with FaviconTabHelper to fetch the specific type of
// favicon.
//
@@ -172,6 +169,15 @@ class FaviconHandler {
history::IconType icon_type;
};
+ struct FaviconCandidate {
+ FaviconCandidate() {}
sky 2012/03/13 23:46:06 Don't inline this, and add a destructor (that isn'
stevenjb 2012/03/14 21:35:26 Done.
+ GURL url;
+ GURL image_url;
+ gfx::Image image;
+ history::IconType icon_type;
+ };
+ typedef std::vector<FaviconCandidate> FaviconCandidates;
+
// See description above class for details.
void OnFaviconDataForInitialURL(FaviconService::Handle handle,
history::FaviconData favicon);
@@ -195,8 +201,17 @@ class FaviconHandler {
history::IconType icon_type,
const FaviconTabHelper::ImageDownloadCallback& callback);
- // Sets the image data for the favicon. This is invoked asynchronously after
- // we request the TabContents to download the favicon.
+ // Adds a favicon candidate. This is invoked asynchronously after we request
+ // the TabContents to download the favicon.
+ void AddFaviconCandidate(const GURL& url,
+ const GURL& icon_url,
+ const gfx::Image& image,
+ history::IconType icon_type);
+
+ // Once all candidates are download, this picks one and calls SetFavicon().
+ void SetFaviconFromCandidates();
+
+ // Sets the image data for the favicon.
void SetFavicon(const GURL& url,
const GURL& icon_url,
const gfx::Image& image,
@@ -267,6 +282,9 @@ class FaviconHandler {
// This handler's delegate.
FaviconHandlerDelegate* delegate_; // weak
+ // Vector of favicon candidates.
+ FaviconCandidates favicon_candidates_;
+
DISALLOW_COPY_AND_ASSIGN(FaviconHandler);
};
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698