Commit 8982d364 authored by Yi Su's avatar Yi Su Committed by Commit Bot

Change favicon size for search engine settings.

Change the desired favicon size in points from 24 to 32 for search
settings, since favicons for prepopulated search engines will be fetched
from google favicon server which only supports 16,32,64,96,180. Favicon
size will be multiplied by screen scale(1, 2, 3), so changing the size
to 32 will meet the size expectation(32, 64, 96) of favicon server.
Otherwise the server will return an icon with default size(16x16), which
looks blur.

Bug: 953246
Change-Id: Ief3ac90941b428987b55dfb298291036484147d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1581202Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Yi Su <mrsuyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653536}
parent 7ecfd946
...@@ -42,6 +42,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -42,6 +42,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
const CGFloat kTableViewSeparatorLeadingInset = 56; const CGFloat kTableViewSeparatorLeadingInset = 56;
const CGFloat kTableViewSeparatorTrailingInset = 16; const CGFloat kTableViewSeparatorTrailingInset = 16;
const int kFaviconDesiredSizeInPoint = 32;
const int kFaviconMinSizeInPoint = 16;
constexpr base::TimeDelta kMaxVisitAge = base::TimeDelta::FromDays(2); constexpr base::TimeDelta kMaxVisitAge = base::TimeDelta::FromDays(2);
const size_t kMaxcustomSearchEngines = 3; const size_t kMaxcustomSearchEngines = 3;
const char kUmaSelectDefaultSearchEngine[] = const char kUmaSelectDefaultSearchEngine[] =
...@@ -232,7 +234,7 @@ const char kUmaSelectDefaultSearchEngine[] = ...@@ -232,7 +234,7 @@ const char kUmaSelectDefaultSearchEngine[] =
FaviconAttributes* cachedAttributes = nil; FaviconAttributes* cachedAttributes = nil;
if (item.type == ItemTypePrepopulatedEngine) { if (item.type == ItemTypePrepopulatedEngine) {
cachedAttributes = _faviconLoader->FaviconForPageUrl( cachedAttributes = _faviconLoader->FaviconForPageUrl(
engineItem.URL, kFaviconPreferredSize, kFaviconMinSize, engineItem.URL, kFaviconDesiredSizeInPoint, kFaviconMinSizeInPoint,
/*fallback_to_google_server=*/YES, ^(FaviconAttributes* attributes) { /*fallback_to_google_server=*/YES, ^(FaviconAttributes* attributes) {
// Only set favicon if the cell hasn't been reused. // Only set favicon if the cell hasn't been reused.
if (urlCell.cellUniqueIdentifier == engineItem.uniqueIdentifier) { if (urlCell.cellUniqueIdentifier == engineItem.uniqueIdentifier) {
...@@ -242,7 +244,7 @@ const char kUmaSelectDefaultSearchEngine[] = ...@@ -242,7 +244,7 @@ const char kUmaSelectDefaultSearchEngine[] =
}); });
} else { } else {
cachedAttributes = _faviconLoader->FaviconForIconUrl( cachedAttributes = _faviconLoader->FaviconForIconUrl(
engineItem.URL, kFaviconPreferredSize, kFaviconMinSize, engineItem.URL, kFaviconDesiredSizeInPoint, kFaviconMinSizeInPoint,
^(FaviconAttributes* attributes) { ^(FaviconAttributes* attributes) {
// Only set favicon if the cell hasn't been reused. // Only set favicon if the cell hasn't been reused.
if (urlCell.cellUniqueIdentifier == engineItem.uniqueIdentifier) { if (urlCell.cellUniqueIdentifier == engineItem.uniqueIdentifier) {
......
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