Implement selection decoration of the main menu. [chromium/src : main]

0 views
Skip to first unread message

Hidehiko Abe (Gerrit)

unread,
Nov 5, 2025, 10:04:45 AM (2 days ago) Nov 5
to Gazal Agarwal, Wenyu Fu, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
Attention needed from Gazal Agarwal

Hidehiko Abe added 2 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Hidehiko Abe . resolved

PTAL.

File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
Line 466, Patchset 1 (Latest): var typedValue = new android.util.TypedValue();
var theme = getContext().getTheme();
theme.resolveAttribute(R.attr.colorSecondary, typedValue, true);
int color = typedValue.data;
Hidehiko Abe . resolved

note: as commented in the bug, this part may need to be updated depending on UX reply.

Open in Gerrit

Related details

Attention is currently required from:
  • Gazal Agarwal
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: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie6032b9b451553329523281e3178812ddbf2256c
Gerrit-Change-Number: 7123563
Gerrit-PatchSet: 1
Gerrit-Owner: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Gazal Agarwal <aga...@google.com>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Jinsuk Kim <jins...@chromium.org>
Gerrit-CC: Mark Schillaci <mschi...@google.com>
Gerrit-CC: Theresa Sullivan <twell...@chromium.org>
Gerrit-CC: Wenyu Fu <wen...@chromium.org>
Gerrit-Attention: Gazal Agarwal <aga...@google.com>
Gerrit-Comment-Date: Wed, 05 Nov 2025 15:04:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hidehiko Abe (Gerrit)

unread,
Nov 6, 2025, 3:10:41 AM (yesterday) Nov 6
to Wenyu Fu, Gazal Agarwal, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
Attention needed from Gazal Agarwal and Wenyu Fu

Hidehiko Abe added 2 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Hidehiko Abe . resolved

R+=Wenyu for OWNER.

Now ready for review, as color issue was resolved. PTAL.

File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
Line 466, Patchset 1: var typedValue = new android.util.TypedValue();

var theme = getContext().getTheme();
theme.resolveAttribute(R.attr.colorSecondary, typedValue, true);
int color = typedValue.data;
Hidehiko Abe . resolved

note: as commented in the bug, this part may need to be updated depending on UX reply.

Hidehiko Abe

fyi: updated.

Open in Gerrit

Related details

Attention is currently required from:
  • Gazal Agarwal
  • Wenyu Fu
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: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie6032b9b451553329523281e3178812ddbf2256c
Gerrit-Change-Number: 7123563
Gerrit-PatchSet: 2
Gerrit-Owner: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Gazal Agarwal <aga...@google.com>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Jinsuk Kim <jins...@chromium.org>
Gerrit-CC: Mark Schillaci <mschi...@google.com>
Gerrit-CC: Theresa Sullivan <twell...@chromium.org>
Gerrit-Attention: Gazal Agarwal <aga...@google.com>
Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
Gerrit-Comment-Date: Thu, 06 Nov 2025 08:10:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Gazal Agarwal (Gerrit)

unread,
Nov 6, 2025, 3:32:53 PM (13 hours ago) Nov 6
to Hidehiko Abe, Wenyu Fu, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
Attention needed from Hidehiko Abe and Wenyu Fu

Gazal Agarwal added 1 comment

File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
Line 190, Patchset 2 (Latest): if (mMultiColumnSettings != null) {
mSelectionDecoration = new SelectionDecoration();
getListView().addItemDecoration(mSelectionDecoration);
}
Gazal Agarwal . unresolved

Most of logic already exists in `ContainmentItemDecoration.java`. We've implemented a MVC pattern that allows custom styling. Please reuse the same.

Two things to consider:

  • The background style will always be a `CARD` for you use case (ContainmentItem.java#BackgroundStyle)
  • The custom background color can be set be overriding `ContainerStyle.java#getBackgroundColor`


cc @wen...@chromium.org

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
  • Wenyu Fu
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: Ie6032b9b451553329523281e3178812ddbf2256c
    Gerrit-Change-Number: 7123563
    Gerrit-PatchSet: 2
    Gerrit-Owner: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Gazal Agarwal <aga...@google.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Wenyu Fu <wen...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: Jinsuk Kim <jins...@chromium.org>
    Gerrit-CC: Mark Schillaci <mschi...@google.com>
    Gerrit-CC: Theresa Sullivan <twell...@chromium.org>
    Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Thu, 06 Nov 2025 20:32:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Wenyu Fu (Gerrit)

    unread,
    Nov 6, 2025, 5:46:09 PM (10 hours ago) Nov 6
    to Hidehiko Abe, Gazal Agarwal, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
    Attention needed from Hidehiko Abe

    Wenyu Fu added 3 comments

    File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
    Line 190, Patchset 2 (Latest): if (mMultiColumnSettings != null) {
    mSelectionDecoration = new SelectionDecoration();
    getListView().addItemDecoration(mSelectionDecoration);
    }
    Gazal Agarwal . unresolved

    Most of logic already exists in `ContainmentItemDecoration.java`. We've implemented a MVC pattern that allows custom styling. Please reuse the same.

    Two things to consider:

    • The background style will always be a `CARD` for you use case (ContainmentItem.java#BackgroundStyle)
    • The custom background color can be set be overriding `ContainerStyle.java#getBackgroundColor`


    cc @wen...@chromium.org

    Wenyu Fu

    +1

    File components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/EmbeddableSettingsPage.java
    Line 43, Patchset 2 (Latest): return null;
    Wenyu Fu . unresolved

    FWIW this is quite prone to error - for fragment that does not have this method override, the highlight will not be applied.

    This also require all the sub-settings to have the correct override, and can be tricky. For example, "Tabs" setting can be on the top-level setting, or it can live within "Appearance" settings (when flag enabled)

    File components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
    Line 271, Patchset 2 (Latest): return "content_settings";
    Wenyu Fu . unresolved

    nit: Can we define constants / intDefs for these instead of using string literals?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Thu, 06 Nov 2025 22:45:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gazal Agarwal <aga...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hidehiko Abe (Gerrit)

    unread,
    Nov 6, 2025, 9:10:19 PM (7 hours ago) Nov 6
    to Wenyu Fu, Gazal Agarwal, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
    Attention needed from Gazal Agarwal and Wenyu Fu

    Hidehiko Abe added 2 comments

    File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
    Line 190, Patchset 2 (Latest): if (mMultiColumnSettings != null) {
    mSelectionDecoration = new SelectionDecoration();
    getListView().addItemDecoration(mSelectionDecoration);
    }
    Gazal Agarwal . unresolved

    Most of logic already exists in `ContainmentItemDecoration.java`. We've implemented a MVC pattern that allows custom styling. Please reuse the same.

    Two things to consider:

    • The background style will always be a `CARD` for you use case (ContainmentItem.java#BackgroundStyle)
    • The custom background color can be set be overriding `ContainerStyle.java#getBackgroundColor`


    cc @wen...@chromium.org

    Wenyu Fu

    +1

    Hidehiko Abe

    ContainmentItemDecoration cannot be used here, because it is for containment, i.e.,

    • each item in the container will be have background always.
    • the rounded corner is applied only for the top and bottom.
    • it does not have "selected" state

    However, we need a custom implemention.

    • We need the background only for selected item.
    • we need rounded corners for each item.

    We can edit ContainmentItemDecoration to put two different implementation in one decoration, and I wouldn't block the path specifically in the future when we may want to apply more containment-style to the main menu as we are on discussion, but for now, splitting the logic looks what we want?

    Or, do you have better ideas, could you share the details with me?

    File components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/EmbeddableSettingsPage.java
    Wenyu Fu . unresolved

    FWIW this is quite prone to error - for fragment that does not have this method override, the highlight will not be applied.

    This also require all the sub-settings to have the correct override, and can be tricky. For example, "Tabs" setting can be on the top-level setting, or it can live within "Appearance" settings (when flag enabled)

    Hidehiko Abe

    This also require all the sub-settings to have the correct override, and can be tricky. For example, "Tabs" setting can be on the top-level setting, or it can live within "Appearance" settings (when flag enabled)

    We only need to override this on the fragment that is "top detailed page", and it will be in effect only when the fragment is at the bottom of the stack.

    So, if "Appearance" is enabled, and Tabs setting is placed under the page, "Appearance" will be only taken care by MainSettings, but "Tabs" will not even if it is put the backstack on top of Appearance.

    If tabs is directly opened, indeed it will be the bottom of the stack, but it wouldn't be problematic, because MainSettings won't have the item anyways.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gazal Agarwal
    • Wenyu Fu
    Gerrit-Attention: Gazal Agarwal <aga...@google.com>
    Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
    Gerrit-Comment-Date: Fri, 07 Nov 2025 02:09:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gazal Agarwal <aga...@google.com>
    Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Gazal Agarwal (Gerrit)

    unread,
    Nov 6, 2025, 9:24:01 PM (7 hours ago) Nov 6
    to Hidehiko Abe, Wenyu Fu, Jinsuk Kim, Theresa Sullivan, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, (Julie)Jeongeun Kim, Mark Schillaci, abigailbk...@google.com, browser-comp...@chromium.org, davidj...@chromium.org, dtraino...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, gogeral...@chromium.org, hanxi...@chromium.org, josiah...@chromium.org, kyungjunle...@google.com, language...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, nektar...@chromium.org, peilinwa...@google.com, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org, yuzo+...@chromium.org
    Attention needed from Hidehiko Abe and Wenyu Fu

    Gazal Agarwal added 1 comment

    File chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
    Line 190, Patchset 2 (Latest): if (mMultiColumnSettings != null) {
    mSelectionDecoration = new SelectionDecoration();
    getListView().addItemDecoration(mSelectionDecoration);
    }
    Gazal Agarwal . unresolved

    Most of logic already exists in `ContainmentItemDecoration.java`. We've implemented a MVC pattern that allows custom styling. Please reuse the same.

    Two things to consider:

    • The background style will always be a `CARD` for you use case (ContainmentItem.java#BackgroundStyle)
    • The custom background color can be set be overriding `ContainerStyle.java#getBackgroundColor`


    cc @wen...@chromium.org

    Wenyu Fu

    +1

    Hidehiko Abe

    ContainmentItemDecoration cannot be used here, because it is for containment, i.e.,

    • each item in the container will be have background always.
    • the rounded corner is applied only for the top and bottom.
    • it does not have "selected" state

    However, we need a custom implemention.

    • We need the background only for selected item.
    • we need rounded corners for each item.

    We can edit ContainmentItemDecoration to put two different implementation in one decoration, and I wouldn't block the path specifically in the future when we may want to apply more containment-style to the main menu as we are on discussion, but for now, splitting the logic looks what we want?

    Or, do you have better ideas, could you share the details with me?

    Gazal Agarwal

    Containment logic is quite flexible and should be able to handle this use case.

    You can use BackgroundStyle.NONE to avoid having a background.
    BackgroundStyle.CARD would take care of the rounded corners on all ends.

    Override `getCustomBackgroundStyle` -> for a custom background style
    Override `getCustomBackgroundColor` -> for a custom background color

    You can look for similar examples in `AdaptiveToolbarHeaderPreference` which has a custom background style and color: https://screenshot.googleplex.com/5jhRme9fq464erh.png

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Wenyu Fu
    Gerrit-Attention: Wenyu Fu <wen...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Fri, 07 Nov 2025 02:23:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gazal Agarwal <aga...@google.com>
    Comment-In-Reply-To: Wenyu Fu <wen...@chromium.org>
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages