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

Unified Diff: components/favicon/core/browser/favicon_handler.h

Issue 1010293002: [Icons NTP] Enable Large Icon URL storage and image fetching (Touch Icons only), behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: components/favicon/core/browser/favicon_handler.h
diff --git a/components/favicon/core/browser/favicon_handler.h b/components/favicon/core/browser/favicon_handler.h
index 5d890c0e940d10cd8440a79540968de4c69abc53..90cd152f169414f2e1cebb8f6e58955b9134c2de 100644
--- a/components/favicon/core/browser/favicon_handler.h
+++ b/components/favicon/core/browser/favicon_handler.h
@@ -76,15 +76,18 @@ class RefCountedMemory;
class FaviconHandler {
public:
- enum Type { FAVICON, TOUCH };
+ enum Type { FAVICON, TOUCH, LARGE };
FaviconHandler(FaviconService* service,
FaviconClient* client,
FaviconDriver* driver,
- Type icon_type,
+ Type handler_type,
bool download_largest_icon);
virtual ~FaviconHandler();
+ // Returns the bit mask of favicon_base::IconType based on the handler's type.
+ static int GetIconTypesFromHandlerType(Type icon_type);
sky 2015/05/06 19:29:05 Why is this public?
huangs 2015/05/06 19:59:14 An oversight from my part. Move to private?
sky 2015/05/06 20:13:54 Yes please.
huangs 2015/05/06 20:33:55 Acknowledged.
+
// Initiates loading the favicon for the specified url.
void FetchFavicon(const GURL& url);
@@ -92,7 +95,7 @@ class FaviconHandler {
// PrerenderContents. Collects the |image_urls| list.
void OnUpdateFaviconURL(const std::vector<favicon::FaviconURL>& candidates);
- // Processes the current image_irls_ entry, requesting the image from the
+ // Processes the current image_urls_ entry, requesting the image from the
// history / download service.
void ProcessCurrentUrl();
@@ -245,7 +248,7 @@ class FaviconHandler {
int preferred_icon_size() const {
if (download_largest_icon_)
return 0;
- return icon_types_ == favicon_base::FAVICON ? gfx::kFaviconSize : 0;
+ return handler_type_ == FAVICON ? gfx::kFaviconSize : 0;
}
// Sorts the entries in |image_urls_| by icon size in descending order.
@@ -275,6 +278,9 @@ class FaviconHandler {
typedef std::map<int, DownloadRequest> DownloadRequests;
DownloadRequests download_requests_;
+ // The type of the current handler.
+ const Type handler_type_;
+
// The combination of the supported icon types.
const int icon_types_;

Powered by Google App Engine
This is Rietveld 408576698