Site search: Init Search Engine component [chromium/src : main]

0 views
Skip to first unread message

Kay Lin (Gerrit)

unread,
Jan 28, 2026, 1:13:27 AM (10 days ago) Jan 28
to chromium...@chromium.org

Kay Lin has uploaded the change for review

Commit message

Site search: Init Search Engine component
Bug: 476026172
Change-Id: I154330018a4ef3f885747b7868e01d861df4f560

Change diff


Change information

Files:
  • M chrome/browser/search_engines/android/BUILD.gn
  • A chrome/browser/search_engines/android/java/res/layout/custom_search_engine_item.xml
  • A chrome/browser/search_engines/android/java/res/layout/custom_search_engine_list_preference.xml
  • A chrome/browser/search_engines/android/java/res/xml/custom_search_engine_preferences.xml
  • M chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/SiteSearchSettings.java
  • A chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListCoordinator.java
  • A chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListMediator.java
  • A chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListPreference.java
Change size: L
Delta: 8 files changed, 353 insertions(+), 2 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I154330018a4ef3f885747b7868e01d861df4f560
Gerrit-Change-Number: 7526405
Gerrit-PatchSet: 1
Gerrit-Owner: Kay Lin <kaiy...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Keigo Oka (Gerrit)

unread,
Jan 28, 2026, 3:41:28 AM (10 days ago) Jan 28
to Kay Lin, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Kay Lin

Keigo Oka added 7 comments

File chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListCoordinator.java
Line 30, Patchset 1: private final LargeIconBridge mLargeIconBridge;
Keigo Oka . unresolved

I think the owner of the bridge is a mediator.

Line 31, Patchset 1: private final TemplateUrlService mTemplateUrlService;
Keigo Oka . unresolved

same here

Line 32, Patchset 1: private final int mFaviconSize;
Keigo Oka . unresolved

same here (looks like it's needed for mediator to retrieve favicon)

Line 55, Patchset 1: private void updateListItems(List<TemplateUrl> urls) {
Keigo Oka . unresolved

Coordinator shouldn't directly update the view. I think we should define our model and bind it to the view. We could refer to https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckViewBinder.java;l=211;drc=69560b66256608765d8611974a452019d262de89 as an example.

I'm not really sure whether we should use PropertyModel or ModelList. ModelList might leads to a cleaner code as the UI becomes complex, but maybe we can start our impl from PropertyModel for simplicity.

Line 81, Patchset 1: mLargeIconBridge.getLargeIconForUrl(
Keigo Oka . unresolved

This should be something mediator should do. The mediator should retrieve the icons and set them to the model

Line 95, Patchset 1: View menuButton = itemView.findViewById(R.id.overflow_menu_button);
Keigo Oka . unresolved

Overflow might be natively supported by PreferenceCategory. Could you try the initialExpandedChildrenCount attribute https://developer.android.com/develop/ui/views/components/settings/components-and-attributes#preferencecategory_attributes

File chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListPreference.java
Line 34, Patchset 1: mCoordinator.onBindViewHolder(holder.itemView);
Keigo Oka . unresolved

The preference shouldn't be aware of coordinator. It should be the SiteSearchSettings that creates a coordinator.

Open in Gerrit

Related details

Attention is currently required from:
  • Kay Lin
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I154330018a4ef3f885747b7868e01d861df4f560
    Gerrit-Change-Number: 7526405
    Gerrit-PatchSet: 1
    Gerrit-Owner: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Keigo Oka <o...@chromium.org>
    Gerrit-Attention: Kay Lin <kaiy...@google.com>
    Gerrit-Comment-Date: Wed, 28 Jan 2026 08:41:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kay Lin (Gerrit)

    unread,
    Jan 28, 2026, 8:39:56 AM (10 days ago) Jan 28
    to Keigo Oka, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Keigo Oka

    Kay Lin added 7 comments

    File chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListCoordinator.java
    Line 30, Patchset 1: private final LargeIconBridge mLargeIconBridge;
    Keigo Oka . resolved

    I think the owner of the bridge is a mediator.

    Kay Lin

    Done

    Line 31, Patchset 1: private final TemplateUrlService mTemplateUrlService;
    Keigo Oka . resolved

    same here

    Kay Lin

    Done

    Line 32, Patchset 1: private final int mFaviconSize;
    Keigo Oka . resolved

    same here (looks like it's needed for mediator to retrieve favicon)

    Kay Lin

    Done

    Line 55, Patchset 1: private void updateListItems(List<TemplateUrl> urls) {
    Keigo Oka . unresolved

    Coordinator shouldn't directly update the view. I think we should define our model and bind it to the view. We could refer to https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckViewBinder.java;l=211;drc=69560b66256608765d8611974a452019d262de89 as an example.

    I'm not really sure whether we should use PropertyModel or ModelList. ModelList might leads to a cleaner code as the UI becomes complex, but maybe we can start our impl from PropertyModel for simplicity.

    Kay Lin

    SG! PTAL

    Line 81, Patchset 1: mLargeIconBridge.getLargeIconForUrl(
    Keigo Oka . resolved

    This should be something mediator should do. The mediator should retrieve the icons and set them to the model

    Kay Lin

    Done

    Line 95, Patchset 1: View menuButton = itemView.findViewById(R.id.overflow_menu_button);
    Keigo Oka . unresolved

    Overflow might be natively supported by PreferenceCategory. Could you try the initialExpandedChildrenCount attribute https://developer.android.com/develop/ui/views/components/settings/components-and-attributes#preferencecategory_attributes

    Kay Lin

    This overflow_menu_button is for editing the rows CRUD. Is that different from what you had in mind?

    File chrome/browser/search_engines/android/java/src/org/chromium/chrome/browser/search_engines/settings/custom_search_engine/CustomSearchEngineListPreference.java
    Line 34, Patchset 1: mCoordinator.onBindViewHolder(holder.itemView);
    Keigo Oka . unresolved

    The preference shouldn't be aware of coordinator. It should be the SiteSearchSettings that creates a coordinator.

    Kay Lin

    If the preference doesn't own the coordinator, then it means SiteSearchSettings needs to delegate the onBindViewHolder to Preference?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keigo Oka
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I154330018a4ef3f885747b7868e01d861df4f560
    Gerrit-Change-Number: 7526405
    Gerrit-PatchSet: 4
    Gerrit-Owner: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Keigo Oka <o...@chromium.org>
    Gerrit-Attention: Keigo Oka <o...@chromium.org>
    Gerrit-Comment-Date: Wed, 28 Jan 2026 13:39:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Keigo Oka <o...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Keigo Oka (Gerrit)

    unread,
    Jan 28, 2026, 9:30:29 PM (10 days ago) Jan 28
    to Kay Lin, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Kay Lin

    Keigo Oka added 1 comment

    File chrome/browser/search_engines/android/java/res/layout/custom_search_engine_list_preference.xml
    Line 12, Patchset 4 (Latest): <androidx.recyclerview.widget.RecyclerView
    Keigo Oka . unresolved

    I conceptually like the design, but I'm not sure whether this is allowed to add a RecyclerView inside a PreferenceFragmentCompat, which also uses RecyclerView internally IIUC. Doesn't it result in a brittle UX (like a scrollable inside a scrollable)? Would you mind splitting this CL to the view and the others, where the view is implemented on top of fake data, and send the view one to review?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kay Lin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I154330018a4ef3f885747b7868e01d861df4f560
    Gerrit-Change-Number: 7526405
    Gerrit-PatchSet: 4
    Gerrit-Owner: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Kay Lin <kaiy...@google.com>
    Gerrit-Reviewer: Keigo Oka <o...@chromium.org>
    Gerrit-Attention: Kay Lin <kaiy...@google.com>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 02:29:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kay Lin (Gerrit)

    unread,
    6:34 AM (6 hours ago) 6:34 AM
    to Keigo Oka, Chromium LUCI CQ, chromium...@chromium.org

    Kay Lin abandoned this change.

    View Change

    Abandoned Obsoleted mvp commit

    Kay Lin abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages