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