Support NavigationHandleUserData attachment for Omnibox [chromium/src : main]

0 views
Skip to first unread message

Huanpo Lin (Gerrit)

unread,
Jun 8, 2026, 11:37:49 PM (3 days ago) Jun 8
to Hiroki Nakagawa, Takashi Toyoshima, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Hiroki Nakagawa and Takashi Toyoshima

Huanpo Lin voted and added 1 comment

Votes added by Huanpo Lin

Commit-Queue+1

1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Hiroki Nakagawa
  • Takashi Toyoshima
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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
Gerrit-Change-Number: 7909261
Gerrit-PatchSet: 5
Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Jun 2026 03:37:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Takashi Toyoshima (Gerrit)

unread,
Jun 9, 2026, 2:19:15 AM (3 days ago) Jun 9
to Huanpo Lin, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Hiroki Nakagawa and Huanpo Lin

Takashi Toyoshima voted and added 1 comment

Votes added by Takashi Toyoshima

Code-Review+1

1 comment

File components/page_load_metrics/browser/navigation_handle_user_data.cc
Line 26, Patchset 5 (Latest):void NavigationHandleUserData::AttachOmniboxTypedNavigationHandleUserData(
Takashi Toyoshima . unresolved

Just in case, if I remember your old change correctly, PLMO's Start callback is invoked before the LoadURLWithParams returns. So, if you want to check the user data in the Start event, this timing might be late.

Open in Gerrit

Related details

Attention is currently required from:
  • Hiroki Nakagawa
  • Huanpo Lin
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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
    Gerrit-Change-Number: 7909261
    Gerrit-PatchSet: 5
    Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
    Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-Comment-Date: Tue, 09 Jun 2026 06:18:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Huanpo Lin (Gerrit)

    unread,
    Jun 9, 2026, 4:32:35 AM (3 days ago) Jun 9
    to Thomas Lukaszewicz, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Hiroki Nakagawa and Thomas Lukaszewicz

    Huanpo Lin added 2 comments

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Huanpo Lin . resolved

    include tluk@ for c/b/u/browser_commands.cc and browser_navigator related files.

    File components/page_load_metrics/browser/navigation_handle_user_data.cc
    Line 26, Patchset 5:void NavigationHandleUserData::AttachOmniboxTypedNavigationHandleUserData(
    Takashi Toyoshima . resolved

    Just in case, if I remember your old change correctly, PLMO's Start callback is invoked before the LoadURLWithParams returns. So, if you want to check the user data in the Start event, this timing might be late.

    Huanpo Lin

    Acked, thanks!
    I'll be aware of the timing when introducing Omnibox logic in the corresponding PLMO.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroki Nakagawa
    • Thomas Lukaszewicz
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • 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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
      Gerrit-Change-Number: 7909261
      Gerrit-PatchSet: 6
      Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
      Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Comment-Date: Tue, 09 Jun 2026 08:32:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Thomas Lukaszewicz (Gerrit)

      unread,
      Jun 9, 2026, 3:22:56 PM (3 days ago) Jun 9
      to Huanpo Lin, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Hiroki Nakagawa and Huanpo Lin

      Thomas Lukaszewicz added 1 comment

      File chrome/browser/ui/navigator/browser_navigator_params.h
      Line 395, Patchset 6 (Latest): base::RepeatingCallback<void(content::NavigationHandle&)>
      Thomas Lukaszewicz . unresolved

      Modifying the bloated `NavigateParams` with a metrics-specific callback is not ideal and likely not necessary.

      `Navigate()` returns a `base::WeakPtr<content::NavigationHandle>` immediately once the navigation has been initiated. Could we instead attach the UserData on the handle after the navigation is requested in `chrome/browser/ui/browser_commands.cc`? i.e. something like

      ```
      auto result = Navigate(&params);

      if (result) {
      if (ui::PageTransitionCoreTypeIs(
      params.transition, ui::PAGE_TRANSITION_TYPED)) {
      page_load_metrics::NavigationHandleUserData::
      AttachOmniboxTypedNavigationHandleUserData(*result);
      } else if (ui::PageTransitionCoreTypeIs(
      params.transition, ui::PAGE_TRANSITION_GENERATED)) {
      page_load_metrics::NavigationHandleUserData::
      AttachOmniboxSuggestedNavigationHandleUserData(*result);
      }
      }
      ...
      ```
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hiroki Nakagawa
      • Huanpo Lin
      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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
        Gerrit-Change-Number: 7909261
        Gerrit-PatchSet: 6
        Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
        Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
        Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-Comment-Date: Tue, 09 Jun 2026 19:22:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Huanpo Lin (Gerrit)

        unread,
        Jun 10, 2026, 12:07:09 AM (2 days ago) Jun 10
        to Thomas Lukaszewicz, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
        Attention needed from Hiroki Nakagawa, Takashi Toyoshima and Thomas Lukaszewicz

        Huanpo Lin voted and added 1 comment

        Votes added by Huanpo Lin

        Commit-Queue+1

        1 comment

        File chrome/browser/ui/navigator/browser_navigator_params.h
        Line 395, Patchset 6: base::RepeatingCallback<void(content::NavigationHandle&)>
        Thomas Lukaszewicz . resolved

        Modifying the bloated `NavigateParams` with a metrics-specific callback is not ideal and likely not necessary.

        `Navigate()` returns a `base::WeakPtr<content::NavigationHandle>` immediately once the navigation has been initiated. Could we instead attach the UserData on the handle after the navigation is requested in `chrome/browser/ui/browser_commands.cc`? i.e. something like

        ```
        auto result = Navigate(&params);

        if (result) {
        if (ui::PageTransitionCoreTypeIs(
        params.transition, ui::PAGE_TRANSITION_TYPED)) {
        page_load_metrics::NavigationHandleUserData::
        AttachOmniboxTypedNavigationHandleUserData(*result);
        } else if (ui::PageTransitionCoreTypeIs(
        params.transition, ui::PAGE_TRANSITION_GENERATED)) {
        page_load_metrics::NavigationHandleUserData::
        AttachOmniboxSuggestedNavigationHandleUserData(*result);
        }
        }
        ...
        ```
        Huanpo Lin

        Updated, PTAL.
        I was thinking of using the callback pattern so it could be used by other trigger types if some triggers happen to hit the same code path.
        Since it is not ideal, I replace it by the page transition checks.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Hiroki Nakagawa
        • Takashi Toyoshima
        • Thomas Lukaszewicz
        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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
          Gerrit-Change-Number: 7909261
          Gerrit-PatchSet: 8
          Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
          Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
          Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
          Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
          Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
          Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
          Gerrit-Comment-Date: Wed, 10 Jun 2026 04:06:37 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Hiroki Nakagawa (Gerrit)

          unread,
          Jun 10, 2026, 12:21:43 AM (2 days ago) Jun 10
          to Huanpo Lin, Thomas Lukaszewicz, Takashi Toyoshima, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
          Attention needed from Huanpo Lin, Takashi Toyoshima and Thomas Lukaszewicz

          Hiroki Nakagawa added 1 comment

          File chrome/browser/ui/browser_commands.cc
          Line 1128, Patchset 8 (Latest): }
          Hiroki Nakagawa . unresolved

          Is it possible to distinguish DUI from DSE by page transition? What about other navigation initiators on Omnibox like AI mode?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Huanpo Lin
          • Takashi Toyoshima
          • Thomas Lukaszewicz
          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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
            Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Comment-Date: Wed, 10 Jun 2026 04:21:09 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Thomas Lukaszewicz (Gerrit)

            unread,
            Jun 10, 2026, 1:49:51 AM (2 days ago) Jun 10
            to Huanpo Lin, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Huanpo Lin and Takashi Toyoshima

            Thomas Lukaszewicz added 1 comment

            Patchset-level comments
            File-level comment, Patchset 8 (Latest):
            Thomas Lukaszewicz . resolved

            Thanks this looks much better - will circle back and +1 after others have approved

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Huanpo Lin
            • Takashi Toyoshima
            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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
            Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Comment-Date: Wed, 10 Jun 2026 05:49:10 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Huanpo Lin (Gerrit)

            unread,
            Jun 10, 2026, 5:12:38 AM (2 days ago) Jun 10
            to Thomas Lukaszewicz, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Hiroki Nakagawa and Takashi Toyoshima

            Huanpo Lin added 1 comment

            File chrome/browser/ui/browser_commands.cc
            Hiroki Nakagawa . unresolved

            Is it possible to distinguish DUI from DSE by page transition? What about other navigation initiators on Omnibox like AI mode?

            Huanpo Lin

            Yes, DUI can be distinguished from DSE by ui::PAGE_TRANSITION_FROM_ADDRESS_BAR x (ui::PAGE_TRANSITION_TYPED, ui::PAGE_TRANSITION_GENERATED)
            https://source.chromium.org/chromium/chromium/src/+/0d2c1d791ba7f07d5b76e2fa1a0af3509ac19d96:chrome/browser/preloading/prerender/prerender_manager.cc;l=230
            https://source.chromium.org/chromium/chromium/src/+/0d2c1d791ba7f07d5b76e2fa1a0af3509ac19d96:chrome/browser/preloading/prerender/prerender_manager.cc;l=392, and the qualifier `ui::PAGE_TRANSITION_FROM_ADDRESS_BAR` is appended by `OmniboxEditModel::OpenMatch`, so it won't be there for AI mode, which is generated by `OmniboxEditModel::NavigateToAiModeWithoutContextualizer` calling `ChromeOmniboxClient::OpenUrl()` directly.
            https://source.chromium.org/chromium/chromium/src/+/5392c43500788023e99230171f83de10299924f3:chrome/browser/ui/omnibox/omnibox_edit_model.cc;l=2983;bpv=1;bpt=0

            The combination ui::PAGE_TRANSITION_FROM_ADDRESS_BAR x (ui::PAGE_TRANSITION_TYPED, ui::PAGE_TRANSITION_GENERATED) should be only related to Omnibox DSE/DUI navigations/preloading.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Hiroki Nakagawa
            • Takashi Toyoshima
            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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Comment-Date: Wed, 10 Jun 2026 09:12:07 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Takashi Toyoshima (Gerrit)

            unread,
            Jun 11, 2026, 2:19:05 AM (yesterday) Jun 11
            to Huanpo Lin, Thomas Lukaszewicz, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Hiroki Nakagawa and Huanpo Lin

            Takashi Toyoshima added 1 comment

            Patchset-level comments
            Takashi Toyoshima . unresolved

            revisit after Hiroki's comment is resolved (please set my attention bit again)

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Hiroki Nakagawa
            • Huanpo Lin
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
            Gerrit-Attention: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Comment-Date: Thu, 11 Jun 2026 06:18:26 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Hiroki Nakagawa (Gerrit)

            unread,
            Jun 11, 2026, 11:27:39 PM (11 hours ago) Jun 11
            to Huanpo Lin, Thomas Lukaszewicz, Takashi Toyoshima, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Huanpo Lin

            Hiroki Nakagawa added 1 comment

            File chrome/browser/ui/navigator/browser_navigator_params.h
            Line 395, Patchset 6: base::RepeatingCallback<void(content::NavigationHandle&)>
            Thomas Lukaszewicz . unresolved

            Modifying the bloated `NavigateParams` with a metrics-specific callback is not ideal and likely not necessary.

            `Navigate()` returns a `base::WeakPtr<content::NavigationHandle>` immediately once the navigation has been initiated. Could we instead attach the UserData on the handle after the navigation is requested in `chrome/browser/ui/browser_commands.cc`? i.e. something like

            ```
            auto result = Navigate(&params);

            if (result) {
            if (ui::PageTransitionCoreTypeIs(
            params.transition, ui::PAGE_TRANSITION_TYPED)) {
            page_load_metrics::NavigationHandleUserData::
            AttachOmniboxTypedNavigationHandleUserData(*result);
            } else if (ui::PageTransitionCoreTypeIs(
            params.transition, ui::PAGE_TRANSITION_GENERATED)) {
            page_load_metrics::NavigationHandleUserData::
            AttachOmniboxSuggestedNavigationHandleUserData(*result);
            }
            }
            ...
            ```
            Huanpo Lin

            Updated, PTAL.
            I was thinking of using the callback pattern so it could be used by other trigger types if some triggers happen to hit the same code path.
            Since it is not ideal, I replace it by the page transition checks.

            Hiroki Nakagawa

            I agree with Robert's initial thought. I think it makes sense to add a field to `NavigateParams` and attach it to the `NavigationHandle` in `Navigate()`, so that we can use the same code path for BookmarkBar, NTP, and other navigation triggers that eventually call `Navigate()`.

            E.g., BookmarkBar:
            https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc;l=164-173;drc=76cd25246c7a238d35ecb0943c6279ee98f9495b

            However, passing a callback might be overkill. Instead, how about directly passing `InitiatorLocation`?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Huanpo Lin
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
            Gerrit-Comment-Date: Fri, 12 Jun 2026 03:27:09 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Huanpo Lin <robe...@chromium.org>
            Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Huanpo Lin (Gerrit)

            unread,
            3:33 AM (7 hours ago) 3:33 AM
            to Thomas Lukaszewicz, Takashi Toyoshima, Hiroki Nakagawa, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Thomas Lukaszewicz

            Huanpo Lin added 1 comment

            File chrome/browser/ui/navigator/browser_navigator_params.h
            Huanpo Lin

            More information about the NavigationHandleUserData attachment design in PS6.
            The original problem was both NTP and BookmarkBar use AUTO_BOOKMARK, so they cannot be distinguished by page transition only, and information of the triggers cannot be hardcoded in content/ due to layer violations.
            The attachment callback function pattern for both NTP and BookmarkBar for metrics recording was created due to this. (http://crrev.com/c/4918014 and http://crrev.com/c/4842248) https://docs.google.com/document/d/1-eZdVXImWMv3o7UA3rut_DKKkE89iqfjiNTHwIAvXAU/edit?usp=sharing
            Using the same pattern (NavigationHandleUserData) to make the logic consistent is favored, so PS6 was used.
            NTP and BookmarkBar are using `OpenURLFromTab` and `OpenAllHelper`, respectively.
            ```auto navigation = chrome::OpenCurrentURL(browser_);``` is likely to be used by omnibox only, so it won't be re-used by other triggers at the moment.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Thomas Lukaszewicz
            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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Comment-Date: Fri, 12 Jun 2026 07:33:10 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Huanpo Lin <robe...@chromium.org>
            Comment-In-Reply-To: Hiroki Nakagawa <nhi...@chromium.org>
            Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Hiroki Nakagawa (Gerrit)

            unread,
            4:00 AM (7 hours ago) 4:00 AM
            to Huanpo Lin, Thomas Lukaszewicz, Takashi Toyoshima, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, jdonnel...@chromium.org, loading-rev...@chromium.org, omnibox-...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
            Attention needed from Huanpo Lin and Thomas Lukaszewicz

            Hiroki Nakagawa added 1 comment

            File chrome/browser/ui/navigator/browser_navigator_params.h
            Hiroki Nakagawa

            and information of the triggers cannot be hardcoded in content/ due to layer violations.

            rakina@ suggests another pattern to make the initiator location injectable from both content/ and chrome/. Can we use this approach to resolve the layering issue?
            https://docs.google.com/document/d/1urfbqZd8Y6iCBenTWEpJFkLO4rm7GlUvnOjFRjQ-cII/edit?disco=AAAB9DbI8U0

            NTP and BookmarkBar are using OpenURLFromTab and OpenAllHelper, respectively.


            auto navigation = chrome::OpenCurrentURL(browser_); is likely to be used by omnibox only, so it won't be re-used by other triggers at the moment.

            To clarify, I mean the reusability of `Navigate()`, not the `Open*()` functions. `OpenCurrentURL()` may not be reused, but it internally calls `Navigate()`, which is already called from various initiator locations. With this approach, those locations can also naturally be supported eventually.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Huanpo Lin
            • Thomas Lukaszewicz
            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: I4d5915780ad873c731f0fab60fdc71a1da82fabe
            Gerrit-Change-Number: 7909261
            Gerrit-PatchSet: 8
            Gerrit-Owner: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-Reviewer: Huanpo Lin <robe...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Huanpo Lin <robe...@chromium.org>
            Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Comment-Date: Fri, 12 Jun 2026 08:00:04 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages