Commit b6eb8c6d authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Mfill Android] Allow more icons in the keyboard accessory

This CL allows icons from the same host as credential icons used in the
keyboard accessory. Additionally, the icon isn't restricted to favicons
anymore: touch icons or manifest icons are considered when looking for
the best-fitting icon.

It does consider subdomains. Example:
 - rsolomakhin.github.com/autofill uses icon from rsolomakhin.github.com
 - rsolomakhin.github.com does not reuse the icon from github.com

The new icon sources besides favicons [1] are:
 - Touch icons (often used to display sites as apps on mobile platforms [2])
 - Web App Manifest icons (defined for PWA-ready sites [3])

[1] often taken from /favicon.ico or <link rel="icon"> tags
[2] https://mathiasbynens.be/notes/touch-icons
[3] https://developer.mozilla.org/en-US/docs/Web/Manifest

Change-Id: I3941f86f6a0a6f6518e405dcc4da390cc0dc0c84
Reviewed-on: https://chromium-review.googlesource.com/c/1353891Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Friedrich Horschig [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612114}
parent 28b38915
...@@ -242,9 +242,12 @@ void PasswordAccessoryControllerImpl::GetFavicon( ...@@ -242,9 +242,12 @@ void PasswordAccessoryControllerImpl::GetFavicon(
return; // The favicon for this origin was already requested. return; // The favicon for this origin was already requested.
favicon_service_->GetRawFaviconForPageURL( favicon_service_->GetRawFaviconForPageURL(
origin.GetURL(), {favicon_base::IconType::kFavicon}, origin.GetURL(),
{favicon_base::IconType::kFavicon, favicon_base::IconType::kTouchIcon,
favicon_base::IconType::kTouchPrecomposedIcon,
favicon_base::IconType::kWebManifestIcon},
desired_size_in_pixel, desired_size_in_pixel,
/* fallback_to_host = */ false, /* fallback_to_host = */ true,
base::BindRepeating( // FaviconService doesn't support BindOnce yet. base::BindRepeating( // FaviconService doesn't support BindOnce yet.
&PasswordAccessoryControllerImpl::OnImageFetched, &PasswordAccessoryControllerImpl::OnImageFetched,
base::AsWeakPtr<PasswordAccessoryControllerImpl>(this), origin), base::AsWeakPtr<PasswordAccessoryControllerImpl>(this), origin),
......
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