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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 10908096: webui: Request favicons at all required display scale factors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index c15c47c581b842c5edcde370cd6441a4833f661e..a30e9d2e903062dc465e02b1682576c320b133f0 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -467,7 +467,8 @@ WebUIController* ChromeWebUIControllerFactory::CreateWebUIControllerForURL(
void ChromeWebUIControllerFactory::GetFaviconForURL(
Profile* profile,
FaviconService::GetFaviconRequest* request,
- const GURL& page_url) const {
+ const GURL& page_url,
+ const std::vector<ui::ScaleFactor>& scale_factors) const {
// Before determining whether page_url is an extension url, we must handle
// overrides. This changes urls in |kChromeUIScheme| to extension urls, and
// allows to use ExtensionWebUI::GetFaviconForURL.
@@ -480,14 +481,16 @@ void ChromeWebUIControllerFactory::GetFaviconForURL(
url.host() != extension_misc::kBookmarkManagerId) {
ExtensionWebUI::GetFaviconForURL(profile, request, url);
} else {
- scoped_refptr<base::RefCountedMemory> bitmap(GetFaviconResourceBytes(
- url, ui::SCALE_FACTOR_100P));
std::vector<history::FaviconBitmapResult> favicon_bitmap_results;
- if (bitmap.get() && bitmap->size()) {
- history::FaviconBitmapResult bitmap_result;
- bitmap_result.bitmap_data = bitmap;
- bitmap_result.icon_type = history::FAVICON;
- favicon_bitmap_results.push_back(bitmap_result);
+ for (size_t i = 0; i < scale_factors.size(); ++i) {
+ scoped_refptr<base::RefCountedMemory> bitmap(GetFaviconResourceBytes(
+ url, scale_factors[i]));
+ if (bitmap.get() && bitmap->size()) {
+ history::FaviconBitmapResult bitmap_result;
+ bitmap_result.bitmap_data = bitmap;
+ bitmap_result.icon_type = history::FAVICON;
+ favicon_bitmap_results.push_back(bitmap_result);
+ }
}
request->ForwardResultAsync(request->handle(), favicon_bitmap_results,
history::IconURLSizesMap());
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698