Add browser controls mojo interface [chromium/src : main]

0 views
Skip to first unread message

Tianyang Xu (Gerrit)

unread,
Jan 7, 2026, 1:35:28 PM (8 days ago) Jan 7
to Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Paul Jensen

Tianyang Xu added 6 comments

Commit Message
Line 7, Patchset 3:Add browser controls mojom interface - Rebacing from Renaming CL
Paul Jensen . resolved

```suggestion
Add browser controls mojo interface
```
There's no need to mention in a commit description that it's rebased, as it won't be once it's landed.

Tianyang Xu

Gotcha, I was adding this to distinguish from the first CL. Removed

Line 9, Patchset 3:Create a new mojom interface to allow us to combine back, forward,
Paul Jensen . resolved

```suggestion
Create a new mojo interface to allow us to combine back, forward,
```

Tianyang Xu

Done

Line 10, Patchset 3:reload, and some other components in WebUI together, and replace
Paul Jensen . resolved

Instead of saying "to allow us to combine..." we should probably say "to provide basic browser controls (e.g. back, forward, reload etc)."

Tianyang Xu

Done

Line 11, Patchset 3:the webui_toolbar.mojom.
Paul Jensen . resolved

Instead of saying "and replace the..." we should probably say "and seed it with...".

Tianyang Xu

Done

Line 12, Patchset 3:
Paul Jensen . resolved

We should mention that this CL also transitions the webui_toolbar to use this new interface.

Tianyang Xu

Done

File components/browser_apis/browser_controls/browser_controls_api_data_model.mojom
Line 7, Patchset 3:// The event flags for the click that might affect disposition of the reload
Paul Jensen . resolved

```suggestion
// The event flags for the click that might affect disposition of a
```

Tianyang Xu

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Paul Jensen
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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
Gerrit-Change-Number: 7405167
Gerrit-PatchSet: 5
Gerrit-Owner: Tianyang Xu <xtls...@google.com>
Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
Gerrit-CC: Paul Jensen <paulj...@chromium.org>
Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
Gerrit-Comment-Date: Wed, 07 Jan 2026 18:35:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Tianyang Xu (Gerrit)

unread,
Jan 8, 2026, 10:36:11 AM (7 days ago) Jan 8
to Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Mingyu Lei, Nasko Oskov and Paul Jensen

Tianyang Xu added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Tianyang Xu . resolved

Removing Rakina due to duplicated reviewers and she is OOO

Open in Gerrit

Related details

Attention is currently required from:
  • Mingyu Lei
  • Nasko Oskov
  • Paul Jensen
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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
Gerrit-Change-Number: 7405167
Gerrit-PatchSet: 5
Gerrit-Owner: Tianyang Xu <xtls...@google.com>
Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
Gerrit-CC: Paul Jensen <paulj...@chromium.org>
Gerrit-Attention: Nasko Oskov <na...@chromium.org>
Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
Gerrit-Attention: Mingyu Lei <le...@chromium.org>
Gerrit-Comment-Date: Thu, 08 Jan 2026 15:36:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nasko Oskov (Gerrit)

unread,
Jan 8, 2026, 10:39:55 AM (7 days ago) Jan 8
to Tianyang Xu, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Mingyu Lei, Paul Jensen and Tianyang Xu

Nasko Oskov added 3 comments

File components/browser_apis/browser_controls/BUILD.gn
Line 1, Patchset 5 (Latest):# Copyright 2025 The Chromium Authors
Nasko Oskov . unresolved

2026?

File components/browser_apis/browser_controls/browser_controls_api.mojom
Line 10, Patchset 5 (Latest):import "mojo/public/mojom/base/error.mojom";
Nasko Oskov . unresolved

I don't see use of the above 3 imports. Can you help me understand why they are necessary?

Line 26, Patchset 5 (Latest):interface BrowserControlsObserver {
Nasko Oskov . unresolved

nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

Open in Gerrit

Related details

Attention is currently required from:
  • Mingyu Lei
  • Paul Jensen
  • Tianyang Xu
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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
    Gerrit-Change-Number: 7405167
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tianyang Xu <xtls...@google.com>
    Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
    Gerrit-CC: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Mingyu Lei <le...@chromium.org>
    Gerrit-Attention: Tianyang Xu <xtls...@google.com>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 15:39:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tianyang Xu (Gerrit)

    unread,
    Jan 8, 2026, 11:32:43 AM (7 days ago) Jan 8
    to Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
    Attention needed from Mingyu Lei, Nasko Oskov and Paul Jensen

    Tianyang Xu added 3 comments

    File components/browser_apis/browser_controls/BUILD.gn
    Line 1, Patchset 5:# Copyright 2025 The Chromium Authors
    Nasko Oskov . resolved

    2026?

    Tianyang Xu

    Done

    File components/browser_apis/browser_controls/browser_controls_api.mojom
    Line 10, Patchset 5:import "mojo/public/mojom/base/error.mojom";
    Nasko Oskov . resolved

    I don't see use of the above 3 imports. Can you help me understand why they are necessary?

    Tianyang Xu

    Good catch! Removed

    Line 26, Patchset 5:interface BrowserControlsObserver {
    Nasko Oskov . unresolved

    nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

    Tianyang Xu

    The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mingyu Lei
    • Nasko Oskov
    • Paul Jensen
    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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
    Gerrit-Change-Number: 7405167
    Gerrit-PatchSet: 6
    Gerrit-Owner: Tianyang Xu <xtls...@google.com>
    Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
    Gerrit-CC: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Nasko Oskov <na...@chromium.org>
    Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Mingyu Lei <le...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 16:32:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nasko Oskov (Gerrit)

    unread,
    Jan 9, 2026, 2:18:52 PM (6 days ago) Jan 9
    to Tianyang Xu, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
    Attention needed from Mingyu Lei, Paul Jensen and Tianyang Xu

    Nasko Oskov added 1 comment

    File components/browser_apis/browser_controls/browser_controls_api.mojom
    Line 26, Patchset 5:interface BrowserControlsObserver {
    Nasko Oskov . unresolved

    nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

    Tianyang Xu

    The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

    Nasko Oskov

    But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mingyu Lei
    • Paul Jensen
    • Tianyang Xu
    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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
    Gerrit-Change-Number: 7405167
    Gerrit-PatchSet: 7
    Gerrit-Owner: Tianyang Xu <xtls...@google.com>
    Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
    Gerrit-CC: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Mingyu Lei <le...@chromium.org>
    Gerrit-Attention: Tianyang Xu <xtls...@google.com>
    Gerrit-Comment-Date: Fri, 09 Jan 2026 19:18:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
    Comment-In-Reply-To: Tianyang Xu <xtls...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Paul Jensen (Gerrit)

    unread,
    Jan 9, 2026, 2:39:58 PM (6 days ago) Jan 9
    to Tianyang Xu, Mingyu Lei, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
    Attention needed from Mingyu Lei and Tianyang Xu

    Paul Jensen added 1 comment

    File components/browser_apis/browser_controls/browser_controls_api.mojom
    Line 26, Patchset 5:interface BrowserControlsObserver {
    Nasko Oskov . unresolved

    nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

    Tianyang Xu

    The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

    Nasko Oskov

    But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

    Paul Jensen

    Hmm, I felt like Observer was a good name for something that received pushed updates/events. Can you advise us on an alternate name suggestion?
    In the deleted webui_toolbar.mojom they used to be called Page & PageHandler, but we received feedback that we should transition them to Observer & Service, especially because in their new shared location they will be used by multiple WebUI pages so the reference to a singular "Page" wasn't appropriate.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mingyu Lei
    • Tianyang Xu
    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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
    Gerrit-Change-Number: 7405167
    Gerrit-PatchSet: 7
    Gerrit-Owner: Tianyang Xu <xtls...@google.com>
    Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
    Gerrit-CC: Paul Jensen <paulj...@chromium.org>
    Gerrit-Attention: Mingyu Lei <le...@chromium.org>
    Gerrit-Attention: Tianyang Xu <xtls...@google.com>
    Gerrit-Comment-Date: Fri, 09 Jan 2026 19:39:52 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nasko Oskov (Gerrit)

    unread,
    Jan 9, 2026, 3:26:55 PM (6 days ago) Jan 9
    to Tianyang Xu, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
    Attention needed from Mingyu Lei and Tianyang Xu

    Nasko Oskov voted and added 2 comments

    Votes added by Nasko Oskov

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Nasko Oskov . resolved

    IPC LGTM

    File components/browser_apis/browser_controls/browser_controls_api.mojom
    Line 26, Patchset 5:interface BrowserControlsObserver {
    Nasko Oskov . unresolved

    nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

    Tianyang Xu

    The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

    Nasko Oskov

    But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

    Paul Jensen

    Hmm, I felt like Observer was a good name for something that received pushed updates/events. Can you advise us on an alternate name suggestion?
    In the deleted webui_toolbar.mojom they used to be called Page & PageHandler, but we received feedback that we should transition them to Observer & Service, especially because in their new shared location they will be used by multiple WebUI pages so the reference to a singular "Page" wasn't appropriate.

    Nasko Oskov

    Observer interfaces usually require an object interested in observing events to register and unregister and usually it involves `ObserverList` or similar. This is why this throws it off for me as it has none of that. It is an interface to communicate state changes (and I would assume in the future other things) to the actual UI seen by the user. I think this is why `page` was used more universally, but I also am not a WebUI dev, so don't know what the current best practice is.

    You all own the code, so I would defer to you, but it just confuses me that an observer interface does not observe anything :). Naming is hard 😜.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mingyu Lei
    • Tianyang Xu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
      Gerrit-Change-Number: 7405167
      Gerrit-PatchSet: 8
      Gerrit-Owner: Tianyang Xu <xtls...@google.com>
      Gerrit-Reviewer: Mingyu Lei <le...@chromium.org>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: Mingyu Lei <le...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Comment-Date: Fri, 09 Jan 2026 20:26:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
      Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
      Comment-In-Reply-To: Tianyang Xu <xtls...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Theresa Sullivan (Gerrit)

      unread,
      Jan 12, 2026, 7:08:58 PM (3 days ago) Jan 12
      to Tianyang Xu, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng, David Yeung, Mingyu Lei and Tianyang Xu

      Theresa Sullivan added 1 comment

      Patchset-level comments
      File-level comment, Patchset 10 (Latest):
      Theresa Sullivan . unresolved

      Hi Tianyang, is there someone in //chrome/browser/ui/waap/OWNERS in the owners set to approve?

      The gerrit UI is indicating I'm on here (as //chrome/OWNERS) for approval, which if true, would ask that a closer OWNERS takes point on most of the review

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • David Yeung
      • Mingyu Lei
      • Tianyang Xu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
      Gerrit-Change-Number: 7405167
      Gerrit-PatchSet: 10
      Gerrit-Owner: Tianyang Xu <xtls...@google.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Yeung <day...@chromium.org>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
      Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: David Yeung <day...@chromium.org>
      Gerrit-Attention: Mingyu Lei <le...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 00:08:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Yeung (Gerrit)

      unread,
      Jan 12, 2026, 7:13:41 PM (3 days ago) Jan 12
      to Tianyang Xu, Theresa Sullivan, Daniel Cheng, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng, Mingyu Lei and Tianyang Xu

      David Yeung added 6 comments

      File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
      Line 23, Patchset 10 (Latest):
      class WebUIToolbarPageHandler
      : public browser_controls_api::mojom::BrowserControlsService {
      David Yeung . unresolved

      The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

      Happy to discuss details elsewhere.

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Line 26, Patchset 5:interface BrowserControlsObserver {
      Nasko Oskov . unresolved

      nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

      Tianyang Xu

      The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

      Nasko Oskov

      But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

      Paul Jensen

      Hmm, I felt like Observer was a good name for something that received pushed updates/events. Can you advise us on an alternate name suggestion?
      In the deleted webui_toolbar.mojom they used to be called Page & PageHandler, but we received feedback that we should transition them to Observer & Service, especially because in their new shared location they will be used by multiple WebUI pages so the reference to a singular "Page" wasn't appropriate.

      Nasko Oskov

      Observer interfaces usually require an object interested in observing events to register and unregister and usually it involves `ObserverList` or similar. This is why this throws it off for me as it has none of that. It is an interface to communicate state changes (and I would assume in the future other things) to the actual UI seen by the user. I think this is why `page` was used more universally, but I also am not a WebUI dev, so don't know what the current best practice is.

      You all own the code, so I would defer to you, but it just confuses me that an observer interface does not observe anything :). Naming is hard 😜.

      David Yeung

      +1 Observer should imply state changes - not UI actions. We should be making these events as stateless as possible.

      For example, rename to `OnNavigationChanged(NavigationState state);` where the state can be `Unknown, Loading, NotLoading.` and then leave the actions to the various webui clients to handle. `Set` implies some type of action and falls back to the page/page handler pattern.

      Line 29, Patchset 10 (Latest): SetReloadButtonState(bool is_loading, bool is_menu_enabled);
      David Yeung . unresolved

      Is the menu tied to the reload button or is it across all browser controls? Can this be its own observer method like OnMenuEnabled?

      Line 42, Patchset 10 (Latest): Reload(bool ignore_cache, array<ClickDispositionFlag> flags);
      David Yeung . unresolved

      ClickDispositionFlag is more of a client/UI concept. What exactly changes for reload when we click on alt versus middle? Can we make it more specific to how reload will change?

      File components/browser_apis/browser_controls/browser_controls_api_data_model.mojom
      Line 9, Patchset 10 (Latest):enum ClickDispositionFlag {
      David Yeung . unresolved

      nit. Consider a kUnknown state.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Mingyu Lei
      • Tianyang Xu
      Gerrit-Attention: Mingyu Lei <le...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 00:13:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fergal Daly (Gerrit)

      unread,
      Jan 13, 2026, 3:07:29 AM (3 days ago) Jan 13
      to Tianyang Xu, Fergal Daly, Theresa Sullivan, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng, Mingyu Lei and Tianyang Xu

      Fergal Daly added 3 comments

      File chrome/browser/resources/webui_toolbar/browser_proxy.ts
      Line 7, Patchset 10 (Latest):import {BrowserControlsFactory, BrowserControlsObserverCallbackRouter, BrowserControlsServiceRemote} from './browser_controls_api.mojom-webui.js';
      Fergal Daly . unresolved

      Minor thing but will the formatter let you put these 1-per-line with a trailing ","? That way all future diffs are adding/removing lines.

      File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
      Line 23, Patchset 10 (Latest):
      class WebUIToolbarPageHandler
      : public browser_controls_api::mojom::BrowserControlsService {
      David Yeung . unresolved

      The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

      Happy to discuss details elsewhere.

      Fergal Daly

      It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

      File components/browser_apis/browser_controls/browser_controls_api_data_model.mojom
      Line 9, Patchset 10 (Latest):enum ClickDispositionFlag {
      David Yeung . unresolved

      nit. Consider a kUnknown state.

      Fergal Daly

      Is there a known use case for an unknown state? I would suggest not adding it until you have something that wants to send the value since handling it might be tricky.

      Gerrit-CC: Fergal Daly <fer...@chromium.org>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: Mingyu Lei <le...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 08:06:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mingyu Lei (Gerrit)

      unread,
      Jan 13, 2026, 6:57:49 AM (3 days ago) Jan 13
      to Tianyang Xu, Fergal Daly, Theresa Sullivan, Daniel Cheng, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Tianyang Xu

      Mingyu Lei added 3 comments

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 5, Patchset 10 (Latest):module browser_controls_api.mojom;
      Mingyu Lei . unresolved

      TBH I think the `xxx_api.mojom` is a bit awkward (also the `tabs_api`), generally speaking everything defined in the mojom can be called "API" right? To me both the tabs APIs and the browser controls APIs are just similar to the other interfaces between different components, and we don't usually put "api" in the mojom namespace.

      I feel that it makes more sense calling the whole thing `//components/browser_controls`, and we have `tab_strip`, `reload`, ... under it. Maybe we should group the reload and back/forward together and call it `navigation`.

      Line 26, Patchset 5:interface BrowserControlsObserver {
      Nasko Oskov . unresolved

      nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

      Tianyang Xu

      The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

      Nasko Oskov

      But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

      Paul Jensen

      Hmm, I felt like Observer was a good name for something that received pushed updates/events. Can you advise us on an alternate name suggestion?
      In the deleted webui_toolbar.mojom they used to be called Page & PageHandler, but we received feedback that we should transition them to Observer & Service, especially because in their new shared location they will be used by multiple WebUI pages so the reference to a singular "Page" wasn't appropriate.

      Nasko Oskov

      Observer interfaces usually require an object interested in observing events to register and unregister and usually it involves `ObserverList` or similar. This is why this throws it off for me as it has none of that. It is an interface to communicate state changes (and I would assume in the future other things) to the actual UI seen by the user. I think this is why `page` was used more universally, but I also am not a WebUI dev, so don't know what the current best practice is.

      You all own the code, so I would defer to you, but it just confuses me that an observer interface does not observe anything :). Naming is hard 😜.

      David Yeung

      +1 Observer should imply state changes - not UI actions. We should be making these events as stateless as possible.

      For example, rename to `OnNavigationChanged(NavigationState state);` where the state can be `Unknown, Loading, NotLoading.` and then leave the actions to the various webui clients to handle. `Set` implies some type of action and falls back to the page/page handler pattern.

      Mingyu Lei

      I think the "observer" sounds more like a proactive role, which registers itself to some source that would produce events, and reacts to those events. The source is simply notifying the observers that something happen, and it's the observer's responsibility to handle it in its own way.

      In this case, `SetReloadButtonState` is more like an instruction from the browser side to update the state of the UI, so it feels a bit weird.

      By the way, while implementing the first version of the mojom, I was simply following [the explainer](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/webui/webui_explainer.md#mojo-interface-definition), and I thought the PageHandler thing is a common pattern in the web UI implementation. I wonder what is special about this `BrowserControlsObserver`?

      especially because in their new shared location they will be used by multiple WebUI pages

      Do we have a design or plan of how this will look like in the future? Maybe it's good to link that in the description.

      Line 42, Patchset 10 (Latest): Reload(bool ignore_cache, array<ClickDispositionFlag> flags);
      David Yeung . unresolved

      ClickDispositionFlag is more of a client/UI concept. What exactly changes for reload when we click on alt versus middle? Can we make it more specific to how reload will change?

      Mingyu Lei

      I think there are also modifier keys information. The handling logic for those are implemented in the browser side (e.g. ctrl+shift+click=hard reload), so it's better to just pass the flags as is.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Tianyang Xu
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 11:57:18 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Giovanni Ortuno Urquidi (Gerrit)

      unread,
      Jan 13, 2026, 11:15:30 AM (2 days ago) Jan 13
      to Tianyang Xu, Giovanni Ortuno Urquidi, Fergal Daly, Theresa Sullivan, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Tianyang Xu

      Giovanni Ortuno Urquidi added 1 comment

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 16:15:20 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Paul Jensen (Gerrit)

      unread,
      Jan 13, 2026, 1:21:37 PM (2 days ago) Jan 13
      to Tianyang Xu, Giovanni Ortuno Urquidi, Fergal Daly, Theresa Sullivan, Daniel Cheng, Mingyu Lei, David Yeung, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Tianyang Xu

      Paul Jensen added 2 comments

      File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
      Line 23, Patchset 10 (Latest):
      class WebUIToolbarPageHandler
      : public browser_controls_api::mojom::BrowserControlsService {
      David Yeung . unresolved

      The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

      Happy to discuss details elsewhere.

      Fergal Daly

      It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

      Paul Jensen

      David, that sounds like a good idea, perhaps we should rename this class to `BrowserControlsService`?

      In the follow-up https://chromium-review.googlesource.com/c/chromium/src/+/7413625 perhaps we could move this file up a couple directories so that it can be used by webui_browser/ stuff too.

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 29, Patchset 10 (Latest): SetReloadButtonState(bool is_loading, bool is_menu_enabled);
      David Yeung . unresolved

      Is the menu tied to the reload button or is it across all browser controls? Can this be its own observer method like OnMenuEnabled?

      Paul Jensen

      It's tied to the reload button. Basically it gets enabled when DevTools is connected. Perhaps, going off your prior suggestion, we should rename this to `OnDevToolsStatusChanged(state)` where the state is `Connected, Disconnected`?

      Gerrit-Comment-Date: Tue, 13 Jan 2026 18:21:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      Jan 13, 2026, 2:03:46 PM (2 days ago) Jan 13
      to Giovanni Ortuno Urquidi, Fergal Daly, Theresa Sullivan, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Theresa Sullivan

      Tianyang Xu added 1 comment

      Patchset-level comments
      Theresa Sullivan . unresolved

      Hi Tianyang, is there someone in //chrome/browser/ui/waap/OWNERS in the owners set to approve?

      The gerrit UI is indicating I'm on here (as //chrome/OWNERS) for approval, which if true, would ask that a closer OWNERS takes point on most of the review

      Tianyang Xu

      Hi Theresa, sorry I didn't clarify that, I added you just for chrome/browser/DEPS I think.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Theresa Sullivan
      Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 19:03:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Theresa Sullivan <twell...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Theresa Sullivan (Gerrit)

      unread,
      Jan 13, 2026, 2:17:57 PM (2 days ago) Jan 13
      to Tianyang Xu, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng

      Theresa Sullivan voted and added 1 comment

      Votes added by Theresa Sullivan

      Code-Review+1

      1 comment

      Patchset-level comments
      Theresa Sullivan . resolved

      Hi Tianyang, is there someone in //chrome/browser/ui/waap/OWNERS in the owners set to approve?

      The gerrit UI is indicating I'm on here (as //chrome/OWNERS) for approval, which if true, would ask that a closer OWNERS takes point on most of the review

      Tianyang Xu

      Hi Theresa, sorry I didn't clarify that, I added you just for chrome/browser/DEPS I think.

      Theresa Sullivan

      chrome/browser/DEPS lgtm!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 19:17:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Theresa Sullivan <twell...@chromium.org>
      Comment-In-Reply-To: Tianyang Xu <xtls...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fred Shih (Gerrit)

      unread,
      Jan 13, 2026, 3:43:10 PM (2 days ago) Jan 13
      to Tianyang Xu, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Tianyang Xu

      Fred Shih added 2 comments

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 5, Patchset 10 (Latest):module browser_controls_api.mojom;
      Mingyu Lei . unresolved

      TBH I think the `xxx_api.mojom` is a bit awkward (also the `tabs_api`), generally speaking everything defined in the mojom can be called "API" right? To me both the tabs APIs and the browser controls APIs are just similar to the other interfaces between different components, and we don't usually put "api" in the mojom namespace.

      I feel that it makes more sense calling the whole thing `//components/browser_controls`, and we have `tab_strip`, `reload`, ... under it. Maybe we should group the reload and back/forward together and call it `navigation`.

      Fred Shih

      For context: mojom interfaces were traditionally more bespoke IPCs between very specific clients (usually 1:1). The API in the name signals that this interface is intended to be used by any client, without any assumption in how the client is implemented. I would've preferred the name "service," but that term is way too overloaded in chrome...

      the *_api.mojom is probably a bit of a stutter though. Maybe module browser_apis.navigation?

      Line 29, Patchset 10 (Latest): SetReloadButtonState(bool is_loading, bool is_menu_enabled);
      David Yeung . unresolved

      Is the menu tied to the reload button or is it across all browser controls? Can this be its own observer method like OnMenuEnabled?

      Paul Jensen

      It's tied to the reload button. Basically it gets enabled when DevTools is connected. Perhaps, going off your prior suggestion, we should rename this to `OnDevToolsStatusChanged(state)` where the state is `Connected, Disconnected`?

      Fred Shih

      +1 to having a state to avoid a world where we have 10 different bools in this method :)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Tianyang Xu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
      Gerrit-Change-Number: 7405167
      Gerrit-PatchSet: 10
      Gerrit-Owner: Tianyang Xu <xtls...@google.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: David Yeung <day...@chromium.org>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
      Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
      Gerrit-CC: Fergal Daly <fer...@chromium.org>
      Gerrit-CC: Fred Shih <ff...@chromium.org>
      Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: Tianyang Xu <xtls...@google.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 20:42:57 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
      Comment-In-Reply-To: Mingyu Lei <le...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Yeung (Gerrit)

      unread,
      Jan 13, 2026, 5:28:55 PM (2 days ago) Jan 13
      to Tianyang Xu, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Daniel Cheng and Tianyang Xu

      David Yeung added 4 comments

      File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
      Line 23, Patchset 10 (Latest):
      class WebUIToolbarPageHandler
      : public browser_controls_api::mojom::BrowserControlsService {
      David Yeung . unresolved

      The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

      Happy to discuss details elsewhere.

      Fergal Daly

      It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

      Paul Jensen

      David, that sounds like a good idea, perhaps we should rename this class to `BrowserControlsService`?

      In the follow-up https://chromium-review.googlesource.com/c/chromium/src/+/7413625 perhaps we could move this file up a couple directories so that it can be used by webui_browser/ stuff too.

      David Yeung

      Renaming to BrowserControlsService sounds good to me.

      accept any clients (WebUIs)" sounds like it has security implications

      We've talked with chrome security during TabStripApi and they've allowed it but it was limited to topchrome webuis. I think its a case by case if the service wants to limit what type of clients can be accepted. The main feedback is that it shouldn't be 1:1.

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      David Yeung

      Factories are used when the WebUI client creates their own remote/receivers and then passes it to the factory instance in the browser to bind. It is an empheral 1:1 relationship where the page is tied to a page handler.

      We do not need this factory interface for TabStripService. Instead many different clients can bind to a persistent service component in the browser.

      Line 29, Patchset 10 (Latest): SetReloadButtonState(bool is_loading, bool is_menu_enabled);
      David Yeung . unresolved

      Is the menu tied to the reload button or is it across all browser controls? Can this be its own observer method like OnMenuEnabled?

      Paul Jensen

      It's tied to the reload button. Basically it gets enabled when DevTools is connected. Perhaps, going off your prior suggestion, we should rename this to `OnDevToolsStatusChanged(state)` where the state is `Connected, Disconnected`?

      Fred Shih

      +1 to having a state to avoid a world where we have 10 different bools in this method :)

      David Yeung

      Yup, I think that's a good suggestion.

      Line 42, Patchset 10 (Latest): Reload(bool ignore_cache, array<ClickDispositionFlag> flags);
      David Yeung . unresolved

      ClickDispositionFlag is more of a client/UI concept. What exactly changes for reload when we click on alt versus middle? Can we make it more specific to how reload will change?

      Mingyu Lei

      I think there are also modifier keys information. The handling logic for those are implemented in the browser side (e.g. ctrl+shift+click=hard reload), so it's better to just pass the flags as is.

      David Yeung

      If its hard reload, we could have flags like `ReloadType{ kNoCache, etc }` instead of click disposition. This abstracts the intent from the input type which makes the service api cleaner and input agnostic.

      The service should really be focused on execution and then it doesn't need to worry about all the other triggers

      Gerrit-Comment-Date: Tue, 13 Jan 2026 22:26:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
      Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Comment-In-Reply-To: Mingyu Lei <le...@chromium.org>
      Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
      Comment-In-Reply-To: Fred Shih <ff...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      Jan 13, 2026, 8:08:48 PM (2 days ago) Jan 13
      to Tianyang Xu, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Tianyang Xu

      Daniel Cheng added 2 comments

      Patchset-level comments
      Daniel Cheng . resolved

      There's already a lot of reviewers, so please don't block on me, but one comment about the factory thing.

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      David Yeung

      Factories are used when the WebUI client creates their own remote/receivers and then passes it to the factory instance in the browser to bind. It is an empheral 1:1 relationship where the page is tied to a page handler.

      We do not need this factory interface for TabStripService. Instead many different clients can bind to a persistent service component in the browser.

      Daniel Cheng

      How would that change this interface? Do you mean that the WebUI would bind the service interface directly?

      While this does add a bit of indirection/boilerplate, there's value to "this remote/receiver pair should always be bound together". Switching to a singleton services shouldn't affect whether or not this is a useful invariant to maintain.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Tianyang Xu
      Gerrit-Comment-Date: Wed, 14 Jan 2026 01:08:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Yeung (Gerrit)

      unread,
      Jan 13, 2026, 11:34:54 PM (2 days ago) Jan 13
      to Tianyang Xu, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Tianyang Xu

      David Yeung added 1 comment

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      David Yeung

      Factories are used when the WebUI client creates their own remote/receivers and then passes it to the factory instance in the browser to bind. It is an empheral 1:1 relationship where the page is tied to a page handler.

      We do not need this factory interface for TabStripService. Instead many different clients can bind to a persistent service component in the browser.

      Daniel Cheng

      How would that change this interface? Do you mean that the WebUI would bind the service interface directly?

      While this does add a bit of indirection/boilerplate, there's value to "this remote/receiver pair should always be bound together". Switching to a singleton services shouldn't affect whether or not this is a useful invariant to maintain.

      David Yeung

      Yes, the WebUI would bind the service directly. You wouldn't need the factory interface. IMO the factory pattern is confusing. I think there is potential for a pattern that has less boilerplate - where clients do not need to know about remote/receivers/binding, and instead it is all taken care of by the service.

      Gerrit-Comment-Date: Wed, 14 Jan 2026 04:34:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Giovanni Ortuno Urquidi (Gerrit)

      unread,
      Jan 14, 2026, 9:39:54 AM (yesterday) Jan 14
      to Tianyang Xu, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Tianyang Xu

      Giovanni Ortuno Urquidi added 1 comment

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10 (Latest):// BrowserControlsFactory is used by the WebUI page to bootstrap communication
      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      David Yeung

      Factories are used when the WebUI client creates their own remote/receivers and then passes it to the factory instance in the browser to bind. It is an empheral 1:1 relationship where the page is tied to a page handler.

      We do not need this factory interface for TabStripService. Instead many different clients can bind to a persistent service component in the browser.

      Daniel Cheng

      How would that change this interface? Do you mean that the WebUI would bind the service interface directly?

      While this does add a bit of indirection/boilerplate, there's value to "this remote/receiver pair should always be bound together". Switching to a singleton services shouldn't affect whether or not this is a useful invariant to maintain.

      David Yeung

      Yes, the WebUI would bind the service directly. You wouldn't need the factory interface. IMO the factory pattern is confusing. I think there is potential for a pattern that has less boilerplate - where clients do not need to know about remote/receivers/binding, and instead it is all taken care of by the service.

      Giovanni Ortuno Urquidi

      I think there is potential for a pattern that has less boilerplate - where clients do not need to know about remote/receivers/binding, and instead it is all taken care of by the service.

      Can you elaborate on what this looks like in practice and how it maintains the invariant dcheng mentioned?

      I agree the factory pattern adds a lot of boilerplate but without it callers end up with interface implementations like this[[1]](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/webui/searchbox/webui_omnibox_handler.cc;l=338-356;drc=4864b1e90893cbda6e50d8e155898acf62758e52) and crashes like this[[2]](https://issues.chromium.org/u/1/issues/468943376?pli=1).

      Gerrit-Comment-Date: Wed, 14 Jan 2026 14:39:44 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      Jan 14, 2026, 10:03:16 AM (yesterday) Jan 14
      to Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Daniel Cheng, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org

      Tianyang Xu added 1 comment

      Patchset-level comments
      Theresa Sullivan . resolved

      Hi Tianyang, is there someone in //chrome/browser/ui/waap/OWNERS in the owners set to approve?

      The gerrit UI is indicating I'm on here (as //chrome/OWNERS) for approval, which if true, would ask that a closer OWNERS takes point on most of the review

      Tianyang Xu

      Hi Theresa, sorry I didn't clarify that, I added you just for chrome/browser/DEPS I think.

      Theresa Sullivan

      chrome/browser/DEPS lgtm!

      Tianyang Xu

      Thanks!

      Open in Gerrit

      Related details

      Attention set is empty
      Gerrit-Comment-Date: Wed, 14 Jan 2026 15:03:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      Jan 14, 2026, 10:03:56 AM (yesterday) Jan 14
      to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org

      Tianyang Xu added 1 comment

      Patchset-level comments
      Tianyang Xu . resolved

      Move Daniel to CC list due to duplicated mojo reviewers

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
      Gerrit-Change-Number: 7405167
      Gerrit-PatchSet: 10
      Gerrit-Owner: Tianyang Xu <xtls...@google.com>
      Gerrit-Reviewer: David Yeung <day...@chromium.org>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
      Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Fergal Daly <fer...@chromium.org>
      Gerrit-CC: Fred Shih <ff...@chromium.org>
      Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 15:03:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      Jan 14, 2026, 11:07:59 AM (yesterday) Jan 14
      to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Fergal Daly

      Tianyang Xu added 1 comment

      File chrome/browser/resources/webui_toolbar/browser_proxy.ts
      Line 7, Patchset 10 (Latest):import {BrowserControlsFactory, BrowserControlsObserverCallbackRouter, BrowserControlsServiceRemote} from './browser_controls_api.mojom-webui.js';
      Fergal Daly . unresolved

      Minor thing but will the formatter let you put these 1-per-line with a trailing ","? That way all future diffs are adding/removing lines.

      Tianyang Xu

      Yeah, this was corrected by the command:
      `git cl format --js --no-python chrome/browser/resources`
      in presubmit warning suggestion. Now I changed it back to three lines.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fergal Daly
      Gerrit-Attention: Fergal Daly <fer...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 16:07:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      Jan 14, 2026, 11:11:29 AM (yesterday) Jan 14
      to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Fergal Daly

      Tianyang Xu added 1 comment

      File chrome/browser/resources/webui_toolbar/browser_proxy.ts
      Line 7, Patchset 10:import {BrowserControlsFactory, BrowserControlsObserverCallbackRouter, BrowserControlsServiceRemote} from './browser_controls_api.mojom-webui.js';
      Fergal Daly . resolved

      Minor thing but will the formatter let you put these 1-per-line with a trailing ","? That way all future diffs are adding/removing lines.

      Tianyang Xu

      Yeah, this was corrected by the command:
      `git cl format --js --no-python chrome/browser/resources`
      in presubmit warning suggestion. Now I changed it back to three lines.

      Tianyang Xu

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fergal Daly
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement 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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
      Gerrit-Change-Number: 7405167
      Gerrit-PatchSet: 11
      Gerrit-Owner: Tianyang Xu <xtls...@google.com>
      Gerrit-Reviewer: David Yeung <day...@chromium.org>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
      Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Fergal Daly <fer...@chromium.org>
      Gerrit-CC: Fred Shih <ff...@chromium.org>
      Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Gerrit-CC: Mingyu Lei <le...@chromium.org>
      Gerrit-CC: Paul Jensen <paulj...@chromium.org>
      Gerrit-Attention: Fergal Daly <fer...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 16:11:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Tianyang Xu <xtls...@google.com>
      Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fred Shih (Gerrit)

      unread,
      Jan 14, 2026, 3:41:25 PM (yesterday) Jan 14
      to Tianyang Xu, Daniel Cheng, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from Fergal Daly

      Fred Shih added 2 comments

      File components/browser_apis/browser_controls/browser_controls_api.mojom
      Line 9, Patchset 10:// BrowserControlsFactory is used by the WebUI page to bootstrap communication

      // to/from the browser process.
      interface BrowserControlsFactory {
      // The WebUI calls this method when the page is first initialized.
      // It binds a pending_remote for the observer and a pending_receiver for the
      // service.
      CreateBrowserControls(
      pending_remote<BrowserControlsObserver> observer,
      pending_receiver<BrowserControlsService> service);
      };
      David Yeung . unresolved

      If we move to the service pattern, we do not need this factory anymore.

      Giovanni Ortuno Urquidi

      What's the service pattern?

      David Yeung

      Factories are used when the WebUI client creates their own remote/receivers and then passes it to the factory instance in the browser to bind. It is an empheral 1:1 relationship where the page is tied to a page handler.

      We do not need this factory interface for TabStripService. Instead many different clients can bind to a persistent service component in the browser.

      Daniel Cheng

      How would that change this interface? Do you mean that the WebUI would bind the service interface directly?

      While this does add a bit of indirection/boilerplate, there's value to "this remote/receiver pair should always be bound together". Switching to a singleton services shouldn't affect whether or not this is a useful invariant to maintain.

      David Yeung

      Yes, the WebUI would bind the service directly. You wouldn't need the factory interface. IMO the factory pattern is confusing. I think there is potential for a pattern that has less boilerplate - where clients do not need to know about remote/receivers/binding, and instead it is all taken care of by the service.

      Giovanni Ortuno Urquidi

      I think there is potential for a pattern that has less boilerplate - where clients do not need to know about remote/receivers/binding, and instead it is all taken care of by the service.

      Can you elaborate on what this looks like in practice and how it maintains the invariant dcheng mentioned?

      I agree the factory pattern adds a lot of boilerplate but without it callers end up with interface implementations like this[[1]](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/webui/searchbox/webui_omnibox_handler.cc;l=338-356;drc=4864b1e90893cbda6e50d8e155898acf62758e52) and crashes like this[[2]](https://issues.chromium.org/u/1/issues/468943376?pli=1).

      Fred Shih

      here is an example of such a usage:
      https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/resources/webui_browser/tab_strip_controller.ts;l=79;bpv=0

      In the above example, the browser side is completely unaware of the webui client and how it's implemented. There isn't any assumption about the client or browser state on bind, so we wouldn't run into the same issue as the omnibox.

      There are cases where we don't necessary want or need the invariance that a remote/receiver pair is bound at the same time. For example, if there is a client that is completely uninterested in receiving updates, it might not want to pass over a receiver at all.

      File components/browser_apis/browser_controls/browser_controls_api_data_model.mojom
      Line 9, Patchset 10:enum ClickDispositionFlag {
      David Yeung . unresolved

      nit. Consider a kUnknown state.

      Fergal Daly

      Is there a known use case for an unknown state? I would suggest not adding it until you have something that wants to send the value since handling it might be tricky.

      Fred Shih

      the risk with having a value assigned to default (0) init is that it's very easy to accidentally express something you didn't intend. For example, if I had something like:

      struct SomeThing {
      ClickDispositionFlag flag;
      };

      And we did something like this: `SomeThing thing = new SomeThing()` and neglect to set `thing.flag`, we'd end up in an undefined state. It is reasonable to use a NOT_REACHED for the kUnknown state on the client side. That might trigger a failure, but at least we don't end up in an undefined state. Maybe kUnspecified is a better name?

      FWIW, this was the recommendation for lacros (which was extensible, but similar idea):
      https://docs.google.com/document/d/17ClARPa5eHH5rhae_N1efZ_ytAEL72Z2QxOaeRo-ZhY/edit?tab=t.0#bookmark=id.wsmctrmzkl5r

      It's also a best practice for protos:
      go/protodosdonts#unspecified-enum

      Gerrit-Comment-Date: Wed, 14 Jan 2026 20:41:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Yeung <day...@chromium.org>
      Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tianyang Xu (Gerrit)

      unread,
      12:42 AM (20 hours ago) 12:42 AM
      to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
      Attention needed from David Yeung, Fergal Daly, Nasko Oskov, Paul Jensen and Theresa Sullivan

      Tianyang Xu added 1 comment

      File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h

      class WebUIToolbarPageHandler
      : public browser_controls_api::mojom::BrowserControlsService {
      David Yeung . resolved

      The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

      Happy to discuss details elsewhere.

      Fergal Daly

      It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

      Paul Jensen

      David, that sounds like a good idea, perhaps we should rename this class to `BrowserControlsService`?

      In the follow-up https://chromium-review.googlesource.com/c/chromium/src/+/7413625 perhaps we could move this file up a couple directories so that it can be used by webui_browser/ stuff too.

      David Yeung

      Renaming to BrowserControlsService sounds good to me.

      accept any clients (WebUIs)" sounds like it has security implications

      We've talked with chrome security during TabStripApi and they've allowed it but it was limited to topchrome webuis. I think its a case by case if the service wants to limit what type of clients can be accepted. The main feedback is that it shouldn't be 1:1.

      Tianyang Xu

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Yeung
      • Fergal Daly
      • Nasko Oskov
      • Paul Jensen
      • Theresa Sullivan
      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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
        Gerrit-Change-Number: 7405167
        Gerrit-PatchSet: 12
        Gerrit-Owner: Tianyang Xu <xtls...@google.com>
        Gerrit-Reviewer: David Yeung <day...@chromium.org>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Fergal Daly <fer...@chromium.org>
        Gerrit-CC: Fred Shih <ff...@chromium.org>
        Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-CC: Mingyu Lei <le...@chromium.org>
        Gerrit-CC: Paul Jensen <paulj...@chromium.org>
        Gerrit-Attention: David Yeung <day...@chromium.org>
        Gerrit-Attention: Nasko Oskov <na...@chromium.org>
        Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 05:42:42 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Yeung <day...@chromium.org>
        Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
        Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Tianyang Xu (Gerrit)

        unread,
        1:38 PM (7 hours ago) 1:38 PM
        to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from David Yeung, Fergal Daly, Nasko Oskov, Paul Jensen and Theresa Sullivan

        Tianyang Xu added 1 comment

        File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
        Line 23, Patchset 10:
        class WebUIToolbarPageHandler
        : public browser_controls_api::mojom::BrowserControlsService {
        David Yeung . unresolved

        The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

        Happy to discuss details elsewhere.

        Fergal Daly

        It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

        Paul Jensen

        David, that sounds like a good idea, perhaps we should rename this class to `BrowserControlsService`?

        In the follow-up https://chromium-review.googlesource.com/c/chromium/src/+/7413625 perhaps we could move this file up a couple directories so that it can be used by webui_browser/ stuff too.

        David Yeung

        Renaming to BrowserControlsService sounds good to me.

        accept any clients (WebUIs)" sounds like it has security implications

        We've talked with chrome security during TabStripApi and they've allowed it but it was limited to topchrome webuis. I think its a case by case if the service wants to limit what type of clients can be accepted. The main feedback is that it shouldn't be 1:1.

        Tianyang Xu

        Done

        Tianyang Xu

        @day...@chromium.org Can you still find the discussion regarding to the unlimited service connection with the chrome security team?

        Gerrit-Comment-Date: Thu, 15 Jan 2026 18:37:52 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Yeung <day...@chromium.org>
        Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Paul Jensen (Gerrit)

        unread,
        1:48 PM (7 hours ago) 1:48 PM
        to Tianyang Xu, Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from David Yeung, Fergal Daly, Nasko Oskov, Theresa Sullivan and Tianyang Xu

        Paul Jensen added 1 comment

        File components/browser_apis/browser_controls/browser_controls_api_data_model.mojom
        Line 9, Patchset 10:enum ClickDispositionFlag {
        David Yeung . unresolved

        nit. Consider a kUnknown state.

        Fergal Daly

        Is there a known use case for an unknown state? I would suggest not adding it until you have something that wants to send the value since handling it might be tricky.

        Fred Shih

        the risk with having a value assigned to default (0) init is that it's very easy to accidentally express something you didn't intend. For example, if I had something like:

        struct SomeThing {
        ClickDispositionFlag flag;
        };

        And we did something like this: `SomeThing thing = new SomeThing()` and neglect to set `thing.flag`, we'd end up in an undefined state. It is reasonable to use a NOT_REACHED for the kUnknown state on the client side. That might trigger a failure, but at least we don't end up in an undefined state. Maybe kUnspecified is a better name?

        FWIW, this was the recommendation for lacros (which was extensible, but similar idea):
        https://docs.google.com/document/d/17ClARPa5eHH5rhae_N1efZ_ytAEL72Z2QxOaeRo-ZhY/edit?tab=t.0#bookmark=id.wsmctrmzkl5r

        It's also a best practice for protos:
        go/protodosdonts#unspecified-enum

        Paul Jensen

        I suggest we follow advice from https://chromium-review.googlesource.com/c/chromium/src/+/7405167/10/components/browser_apis/browser_controls/browser_controls_api.mojom#42 and consider getting rid of this enum entirely, and switch to two more explicit APIs without enums:

          Reload(bool bypass_cache);  (instead of when shift or control key is used)

        DuplicateCurrentTab(); (instead of when middle click is used)
        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Yeung
        • Fergal Daly
        • Nasko Oskov
        • Theresa Sullivan
        • Tianyang Xu
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Tianyang Xu <xtls...@google.com>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 18:48:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Yeung <day...@chromium.org>
        Comment-In-Reply-To: Fred Shih <ff...@chromium.org>
        Comment-In-Reply-To: Fergal Daly <fer...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Paul Jensen (Gerrit)

        unread,
        1:58 PM (7 hours ago) 1:58 PM
        to Tianyang Xu, Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from David Yeung, Fergal Daly, Nasko Oskov, Theresa Sullivan and Tianyang Xu

        Paul Jensen added 2 comments

        File components/browser_apis/browser_controls/browser_controls_api.mojom
        Line 46, Patchset 13 (Latest): // Stops the current page from reloading. If the page is not in a loading
        Paul Jensen . unresolved
        This stops any load, not just reloads, so proposing a reword:
        ```suggestion
        // Stops the current page from loading. If the page is not in a loading
        ```
        Line 48, Patchset 13 (Latest): StopReload();
        Paul Jensen . unresolved
        This stops any load, not just reloads, so proposing a rename:
        ```suggestion
        StopLoad();
        ```
        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Yeung
        • Fergal Daly
        • Nasko Oskov
        • Theresa Sullivan
        • Tianyang Xu
        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: I1f68d019f838fb93f32e712e1d07c7753f1bdb22
        Gerrit-Change-Number: 7405167
        Gerrit-PatchSet: 13
        Gerrit-Owner: Tianyang Xu <xtls...@google.com>
        Gerrit-Reviewer: David Yeung <day...@chromium.org>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Reviewer: Tianyang Xu <xtls...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Fergal Daly <fer...@chromium.org>
        Gerrit-CC: Fred Shih <ff...@chromium.org>
        Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-CC: Mingyu Lei <le...@chromium.org>
        Gerrit-CC: Paul Jensen <paulj...@chromium.org>
        Gerrit-Attention: David Yeung <day...@chromium.org>
        Gerrit-Attention: Nasko Oskov <na...@chromium.org>
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Tianyang Xu <xtls...@google.com>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 18:58:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        David Yeung (Gerrit)

        unread,
        2:15 PM (6 hours ago) 2:15 PM
        to Tianyang Xu, Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from Fergal Daly, Nasko Oskov, Theresa Sullivan and Tianyang Xu

        David Yeung added 1 comment

        File chrome/browser/ui/webui/webui_toolbar/webui_toolbar_page_handler.h
        Line 23, Patchset 10:
        class WebUIToolbarPageHandler
        : public browser_controls_api::mojom::BrowserControlsService {
        David Yeung . unresolved

        The idea of a service is that we can reuse it across multiple UIs, instead of strictly tied to the WebUIToolbarPageHandler. It should be able to stand up by itself and stateless to handle multiple clients. Take a look at [TabStripService](https://crsrc.org/c/chrome/browser/ui/tabs/tab_strip_api/tab_strip_service_mojo_handler.cc;drc=07ba8b6a0f60aa5d68af93ef447b3979a4eb09f9;l=13) as an example. It exists in the browser process and we accept any clients (WebUIs) that bind to it.

        Happy to discuss details elsewhere.

        Fergal Daly

        It's not happening in this CL, so it's not blocking but is there a design doc somewhere that describes this full plan? "accept any clients (WebUIs)" sounds like it has security implications, e.g. maybe we should only accept clients that are specifically known to be THE toolbar renderer.

        Paul Jensen

        David, that sounds like a good idea, perhaps we should rename this class to `BrowserControlsService`?

        In the follow-up https://chromium-review.googlesource.com/c/chromium/src/+/7413625 perhaps we could move this file up a couple directories so that it can be used by webui_browser/ stuff too.

        David Yeung

        Renaming to BrowserControlsService sounds good to me.

        accept any clients (WebUIs)" sounds like it has security implications

        We've talked with chrome security during TabStripApi and they've allowed it but it was limited to topchrome webuis. I think its a case by case if the service wants to limit what type of clients can be accepted. The main feedback is that it shouldn't be 1:1.

        Tianyang Xu

        Done

        Tianyang Xu

        @day...@chromium.org Can you still find the discussion regarding to the unlimited service connection with the chrome security team?

        David Yeung

        It was in a CL thread when we made tabstripservice but I don't recall which one.

        If this is a blocker, we can start new discussion with chrome security folks about what it would take to allow 1 to many. I understand there are security implications for untrusted urls on other WebUIs, but ideally webium should be a 1st party citizen. We should make sure it follows all of the safety protocols while being able to do all of the actions necessary for a top chrome webui page.

        Open in Gerrit

        Related details

        Attention is currently required from:
        Gerrit-Attention: Nasko Oskov <na...@chromium.org>
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Tianyang Xu <xtls...@google.com>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 19:15:39 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Yeung <day...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Tianyang Xu (Gerrit)

        unread,
        3:29 PM (5 hours ago) 3:29 PM
        to Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, David Yeung, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from Daniel Cheng, David Yeung, Fergal Daly, Fred Shih, Giovanni Ortuno Urquidi, Mingyu Lei, Nasko Oskov, Paul Jensen and Theresa Sullivan

        Tianyang Xu added 1 comment

        File components/browser_apis/browser_controls/browser_controls_api.mojom
        Line 26, Patchset 5:interface BrowserControlsObserver {
        Nasko Oskov . unresolved

        nit: This is a bit of unconventional naming, as it is an API the browser uses to invoke state changes in the renderer process. If it does that because implementation-wise it observes some changes, that's fine, but it is an implementation detail that is leaked in the name.

        Tianyang Xu

        The "Observer" in the name of this interface, which is implemented by the renderer, refers to the renderer observing browser events, rather than referring to a possible implementation detail where the browser observes and forwards these events.

        Nasko Oskov

        But the renderer is not actually observing the events in the browser. It doesn't subscribe to any observation that I can see. The browser process pushes the updates to the renderer and it responds to those.

        Paul Jensen

        Hmm, I felt like Observer was a good name for something that received pushed updates/events. Can you advise us on an alternate name suggestion?
        In the deleted webui_toolbar.mojom they used to be called Page & PageHandler, but we received feedback that we should transition them to Observer & Service, especially because in their new shared location they will be used by multiple WebUI pages so the reference to a singular "Page" wasn't appropriate.

        Nasko Oskov

        Observer interfaces usually require an object interested in observing events to register and unregister and usually it involves `ObserverList` or similar. This is why this throws it off for me as it has none of that. It is an interface to communicate state changes (and I would assume in the future other things) to the actual UI seen by the user. I think this is why `page` was used more universally, but I also am not a WebUI dev, so don't know what the current best practice is.

        You all own the code, so I would defer to you, but it just confuses me that an observer interface does not observe anything :). Naming is hard 😜.

        David Yeung

        +1 Observer should imply state changes - not UI actions. We should be making these events as stateless as possible.

        For example, rename to `OnNavigationChanged(NavigationState state);` where the state can be `Unknown, Loading, NotLoading.` and then leave the actions to the various webui clients to handle. `Set` implies some type of action and falls back to the page/page handler pattern.

        Mingyu Lei

        I think the "observer" sounds more like a proactive role, which registers itself to some source that would produce events, and reacts to those events. The source is simply notifying the observers that something happen, and it's the observer's responsibility to handle it in its own way.

        In this case, `SetReloadButtonState` is more like an instruction from the browser side to update the state of the UI, so it feels a bit weird.

        By the way, while implementing the first version of the mojom, I was simply following [the explainer](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/webui/webui_explainer.md#mojo-interface-definition), and I thought the PageHandler thing is a common pattern in the web UI implementation. I wonder what is special about this `BrowserControlsObserver`?

        especially because in their new shared location they will be used by multiple WebUI pages

        Do we have a design or plan of how this will look like in the future? Maybe it's good to link that in the description.

        Tianyang Xu

        @day...@chromium.org Here is a quick proposal for this CL. I think it is better to modify the new service and observer interfaces and methods in this CL, and put the factory mode refactor stuff in a following one. What do you think?
        https://docs.google.com/document/d/16n018AQk-rj7LWy2fyIaaWMdivBbG9EKij1TFin8BmE/edit?usp=sharing

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Daniel Cheng
        • David Yeung
        • Fergal Daly
        • Fred Shih
        • Giovanni Ortuno Urquidi
        • Mingyu Lei
        • Nasko Oskov
        • Paul Jensen
        • Theresa Sullivan
        Gerrit-Attention: David Yeung <day...@chromium.org>
        Gerrit-Attention: Nasko Oskov <na...@chromium.org>
        Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-Attention: Mingyu Lei <le...@chromium.org>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Attention: Fred Shih <ff...@chromium.org>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 20:29:26 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Yeung <day...@chromium.org>
        Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
        Comment-In-Reply-To: Paul Jensen <paulj...@chromium.org>
        Comment-In-Reply-To: Mingyu Lei <le...@chromium.org>
        Comment-In-Reply-To: Tianyang Xu <xtls...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        David Yeung (Gerrit)

        unread,
        6:21 PM (2 hours ago) 6:21 PM
        to Tianyang Xu, Daniel Cheng, Fred Shih, Theresa Sullivan, Giovanni Ortuno Urquidi, Fergal Daly, Mingyu Lei, Paul Jensen, Chromium LUCI CQ, chromium...@chromium.org, ipc-securi...@chromium.org
        Attention needed from Daniel Cheng, Fergal Daly, Fred Shih, Giovanni Ortuno Urquidi, Mingyu Lei, Nasko Oskov, Paul Jensen, Theresa Sullivan and Tianyang Xu

        David Yeung added 1 comment

        File components/browser_apis/browser_controls/browser_controls_api.mojom
        David Yeung

        Direction looks good to me! Left some comments. Thanks for bringing up the security concern.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Daniel Cheng
        • Fergal Daly
        • Fred Shih
        • Giovanni Ortuno Urquidi
        • Mingyu Lei
        • Nasko Oskov
        • Paul Jensen
        • Theresa Sullivan
        • Tianyang Xu
        Gerrit-Attention: Nasko Oskov <na...@chromium.org>
        Gerrit-Attention: Paul Jensen <paulj...@chromium.org>
        Gerrit-Attention: Theresa Sullivan <twell...@chromium.org>
        Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
        Gerrit-Attention: Mingyu Lei <le...@chromium.org>
        Gerrit-Attention: Tianyang Xu <xtls...@google.com>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Attention: Fred Shih <ff...@chromium.org>
        Gerrit-Attention: Fergal Daly <fer...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 23:21:26 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages