Commit 38f10c19 authored by Rahul Goyal's avatar Rahul Goyal Committed by Commit Bot

[Autofill Assistant] Added optional |website_url| for favicon logic in FaviconDrawableProto


Bug: b/171025821
Change-Id: I45cb6e3af454c7790fb8ad4ee6494ece06b847e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2516500
Commit-Queue: Rahul Goyal <goyalrahul@google.com>
Reviewed-by: default avatarLuca Hunkeler <hluca@google.com>
Cr-Commit-Position: refs/heads/master@{#823514}
parent 39f42704
......@@ -198,10 +198,11 @@ base::android::ScopedJavaLocalRef<jobject> CreateJavaDrawable(
int diameter_size_in_pixel =
ui_controller_android_utils::GetPixelSizeOrDefault(
env, jcontext, proto.favicon().diameter_size(), 0);
std::string url = proto.favicon().has_website_url()
? proto.favicon().website_url()
: user_model->GetCurrentURL().spec();
return Java_AssistantDrawable_createFromFavicon(
env,
base::android::ConvertUTF8ToJavaString(
env, user_model->GetCurrentURL().spec()),
env, base::android::ConvertUTF8ToJavaString(env, url),
diameter_size_in_pixel, proto.favicon().force_monogram());
}
case DrawableProto::DRAWABLE_NOT_SET:
......
......@@ -77,6 +77,9 @@ message FaviconDrawableProto {
optional ClientDimensionProto diameter_size = 1;
// If true, we always use the monogram, even if the favicon is available.
optional bool force_monogram = 2;
// If set, this url is used to fetch favicon, otherwise current url is used to
// fetch favicon.
optional string website_url = 3;
}
// A drawable for use in backgrounds or in image views.
......
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