Commit 47fcdcbb authored by minggang.wang's avatar minggang.wang Committed by Commit bot

Currently, we are caching the default favicon, but the scale factor is

ignored. So we need to remove this in order to take the required scale
factor into account.

BUG=668023

Review-Url: https://codereview.chromium.org/2535463002
Cr-Commit-Position: refs/heads/master@{#436237}
parent 60f4f97a
......@@ -476,6 +476,7 @@ Mike Tilburg <mtilburg@adobe.com>
Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Milko Leporis <milko.leporis@imgtec.com>
Milton Chiang <milton.chiang@mediatek.com>
Minggang Wang <minggang.wang@intel.com>
Mingmin Xie <melvinxie@gmail.com>
Minsoo Max Koo <msu.koo@samsung.com>
Miran Karic <miran.karic@imgtec.com>
......
......@@ -178,33 +178,23 @@ void FaviconSource::SendDefaultResponse(
}
void FaviconSource::SendDefaultResponse(const IconRequest& icon_request) {
int favicon_index;
int resource_id;
switch (icon_request.size_in_dip) {
case 64:
favicon_index = SIZE_64;
resource_id = IDR_DEFAULT_FAVICON_64;
break;
case 32:
favicon_index = SIZE_32;
resource_id = IDR_DEFAULT_FAVICON_32;
break;
default:
favicon_index = SIZE_16;
resource_id = IDR_DEFAULT_FAVICON;
break;
}
base::RefCountedMemory* default_favicon =
default_favicons_[favicon_index].get();
if (!default_favicon) {
ui::ScaleFactor resource_scale_factor =
ui::GetSupportedScaleFactor(icon_request.device_scale_factor);
default_favicon =
ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
resource_id, resource_scale_factor);
default_favicons_[favicon_index] = default_favicon;
}
ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
resource_id,
ui::GetSupportedScaleFactor(icon_request.device_scale_factor));
icon_request.callback.Run(default_favicon);
}
......@@ -127,10 +127,6 @@ class FaviconSource : public content::URLDataSource {
base::CancelableTaskTracker cancelable_task_tracker_;
// Raw PNG representations of favicons of each size to show when the favicon
// database doesn't have a favicon for a webpage. Indexed by IconSize values.
scoped_refptr<base::RefCountedMemory> default_favicons_[NUM_SIZES];
// The favicon_base::IconTypes of icon that this FaviconSource handles.
int icon_types_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment