Commit dde9aceb authored by huangs's avatar huangs Committed by Commit bot

[Icons NTP] Enable Touch Icon parsing, so Chrome gets URL (no fetch or storage).

This CL makes Apple Touch Icon URLs will be parsed in Blink and passed to
FaviconTabHelper::DidUpdateFaviconURL().  This used to be enabled for Android
only.  On desktop the URLs are parsed, but ignored (so storage into Favicon
DB and no image fetching yet).

BUG=467712

Review URL: https://codereview.chromium.org/1007563004

Cr-Commit-Position: refs/heads/master@{#320975}
parent 270f6229
......@@ -29,6 +29,9 @@ using blink::WebRuntimeFeatures;
namespace content {
static void SetRuntimeFeatureDefaultsForPlatform() {
// Enable non-standard "apple-touch-icon" and "apple-touch-icon-precomposed".
WebRuntimeFeatures::enableTouchIconLoading(true);
#if defined(OS_ANDROID)
// MSE/EME implementation needs Android MediaCodec API.
if (!media::MediaCodecBridge::IsAvailable()) {
......@@ -52,7 +55,6 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
WebRuntimeFeatures::enableSharedWorker(false);
// Android does not yet support NavigatorContentUtils.
WebRuntimeFeatures::enableNavigatorContentUtils(false);
WebRuntimeFeatures::enableTouchIconLoading(true);
WebRuntimeFeatures::enableOrientationEvent(true);
WebRuntimeFeatures::enableFastMobileScrolling(true);
WebRuntimeFeatures::enableMediaCapture(true);
......
......@@ -451,15 +451,6 @@ class WebWidgetLockTarget : public MouseLockDispatcher::LockTarget {
blink::WebWidget* webwidget_;
};
bool TouchEnabled() {
// Based on the definition of chrome::kEnableTouchIcon.
#if defined(OS_ANDROID)
return true;
#else
return false;
#endif
}
WebDragData DropDataToWebDragData(const DropData& drop_data) {
std::vector<WebDragData::Item> item_list;
......@@ -2269,9 +2260,6 @@ void RenderViewImpl::didChangeIcon(WebLocalFrame* frame,
if (frame->parent())
return;
if (!TouchEnabled() && icon_type != WebIconURL::TypeFavicon)
return;
WebVector<WebIconURL> icon_urls = frame->iconURLs(icon_type);
std::vector<FaviconURL> urls;
for (size_t i = 0; i < icon_urls.size(); i++) {
......@@ -3976,9 +3964,8 @@ void RenderViewImpl::SendUpdateFaviconURL(const std::vector<FaviconURL>& urls) {
}
void RenderViewImpl::DidStopLoadingIcons() {
int icon_types = WebIconURL::TypeFavicon;
if (TouchEnabled())
icon_types |= WebIconURL::TypeTouchPrecomposed | WebIconURL::TypeTouch;
int icon_types = WebIconURL::TypeFavicon | WebIconURL::TypeTouchPrecomposed |
WebIconURL::TypeTouch;
// Favicons matter only for the top-level frame. If it is a WebRemoteFrame,
// just return early.
......
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