[Part 2] Hook up back button to back-to-opener functionality [chromium/src : main]

0 views
Skip to first unread message

Diana Qu (Gerrit)

unread,
Jan 9, 2026, 10:59:20 PM (6 days ago) Jan 9
to Darryl James, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Darryl James

Diana Qu added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Diana Qu . resolved

Sending this one out~ I had to do some refactor in browser_command.cc. Let me know if you think that’s okay.

Open in Gerrit

Related details

Attention is currently required from:
  • Darryl James
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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
Gerrit-Change-Number: 7426191
Gerrit-PatchSet: 3
Gerrit-Owner: Diana Qu <xi...@microsoft.com>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Comment-Date: Sat, 10 Jan 2026 03:59:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Darryl James (Gerrit)

unread,
Jan 13, 2026, 7:58:25 PM (2 days ago) Jan 13
to Diana Qu, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Diana Qu

Darryl James voted and added 4 comments

Votes added by Darryl James

Code-Review+1

4 comments

Patchset-level comments
Darryl James . resolved

lgtm % small comments; Nice work!

File chrome/browser/ui/browser_commands.cc
Line 934, Patchset 3 (Latest): if (CanGoBackToOpener(web_contents)) {
tabs::TabInterface* tab =
tabs::TabInterface::MaybeGetFromContents(web_contents);
Darryl James . unresolved

optional: It might be worth finding a way to only query for the tab and controller once. I noticed that CanGoBackToOpener and the code within this block re-query for the tab / controller.

I don't believe this is an expensive operation so I am fine with this as is 👍

File chrome/browser/ui/tabs/back_to_opener/back_to_opener_browsertest.cc
Line 63, Patchset 3 (Latest): static_cast<BrowserWindowInterface*>(browser()));
Darryl James . unresolved

Is the cast needed here? I would assume no since `Browser` extends `BrowserWindowInterface` already 👍

Line 188, Patchset 3 (Latest):}
Darryl James . unresolved

super nit: new line after this one to separate the test below

Open in Gerrit

Related details

Attention is currently required from:
  • Diana Qu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
Gerrit-Change-Number: 7426191
Gerrit-PatchSet: 3
Gerrit-Owner: Diana Qu <xi...@microsoft.com>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
Gerrit-Attention: Diana Qu <xi...@microsoft.com>
Gerrit-Comment-Date: Wed, 14 Jan 2026 00:58:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Diana Qu (Gerrit)

unread,
Jan 14, 2026, 8:00:48 PM (yesterday) Jan 14
to Darryl James, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Darryl James

Diana Qu added 4 comments

Patchset-level comments
Diana Qu . resolved

Hi Darryl! I updated a bit base on your comment! Could you take another look when you get a chance?
Also do you mind add another reviewer that you think would be good to take a look at this?

(Since part 1 is still pending Takashi's review. So no rush on this one.)

File chrome/browser/ui/browser_commands.cc
Line 934, Patchset 3 (Latest): if (CanGoBackToOpener(web_contents)) {
tabs::TabInterface* tab =
tabs::TabInterface::MaybeGetFromContents(web_contents);
Darryl James . unresolved

optional: It might be worth finding a way to only query for the tab and controller once. I noticed that CanGoBackToOpener and the code within this block re-query for the tab / controller.

I don't believe this is an expensive operation so I am fine with this as is 👍

Diana Qu

I created another helper with different parameter!

File chrome/browser/ui/tabs/back_to_opener/back_to_opener_browsertest.cc
Line 63, Patchset 3 (Latest): static_cast<BrowserWindowInterface*>(browser()));
Darryl James . unresolved

Is the cast needed here? I would assume no since `Browser` extends `BrowserWindowInterface` already 👍

Diana Qu

Ah that make sense. Updated all test around cast.

Darryl James . unresolved

super nit: new line after this one to separate the test below

Diana Qu

Thanks! Updated.

Open in Gerrit

Related details

Attention is currently required from:
  • Darryl James
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
Gerrit-Change-Number: 7426191
Gerrit-PatchSet: 3
Gerrit-Owner: Diana Qu <xi...@microsoft.com>
Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
Gerrit-Attention: Darryl James <dlj...@chromium.org>
Gerrit-Comment-Date: Thu, 15 Jan 2026 01:00:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darryl James (Gerrit)

unread,
Jan 14, 2026, 8:09:42 PM (yesterday) Jan 14
to Diana Qu, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Diana Qu

Darryl James voted and added 4 comments

Votes added by Darryl James

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Darryl James . resolved

lgtm! Awesome work here!

File chrome/browser/ui/browser_commands.cc
Line 934, Patchset 3: if (CanGoBackToOpener(web_contents)) {

tabs::TabInterface* tab =
tabs::TabInterface::MaybeGetFromContents(web_contents);
Darryl James . resolved

optional: It might be worth finding a way to only query for the tab and controller once. I noticed that CanGoBackToOpener and the code within this block re-query for the tab / controller.

I don't believe this is an expensive operation so I am fine with this as is 👍

Diana Qu

I created another helper with different parameter!

Darryl James

Sweet!

Because you have inverted the condition by checking the tab first you can also consider getting rid of the new function and inline the `controller && controller->CanGoBackToOpener` at the callsites if you wanted.

Marking as resolved though since that is ultimately preference, nice work!

File chrome/browser/ui/tabs/back_to_opener/back_to_opener_browsertest.cc
Line 63, Patchset 3: static_cast<BrowserWindowInterface*>(browser()));
Darryl James . resolved

Is the cast needed here? I would assume no since `Browser` extends `BrowserWindowInterface` already 👍

Diana Qu

Ah that make sense. Updated all test around cast.

Darryl James

Done

Line 188, Patchset 3:}
Darryl James . resolved

super nit: new line after this one to separate the test below

Diana Qu

Thanks! Updated.

Darryl James

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Diana Qu
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
    Gerrit-Change-Number: 7426191
    Gerrit-PatchSet: 4
    Gerrit-Owner: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
    Gerrit-Attention: Diana Qu <xi...@microsoft.com>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 01:09:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Diana Qu <xi...@microsoft.com>
    Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Darryl James (Gerrit)

    unread,
    Jan 14, 2026, 8:13:33 PM (yesterday) Jan 14
    to Diana Qu, David Pennington, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from David Pennington and Diana Qu

    Darryl James added 1 comment

    Patchset-level comments
    Diana Qu . resolved

    Hi Darryl! I updated a bit base on your comment! Could you take another look when you get a chance?
    Also do you mind add another reviewer that you think would be good to take a look at this?

    (Since part 1 is still pending Takashi's review. So no rush on this one.)

    Darryl James

    Great work! I can poke around and find someone to help with this review for you!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Diana Qu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
    Gerrit-Change-Number: 7426191
    Gerrit-PatchSet: 4
    Gerrit-Owner: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Diana Qu <xi...@microsoft.com>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 01:13:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Diana Qu <xi...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Darryl James (Gerrit)

    unread,
    Jan 14, 2026, 8:15:49 PM (yesterday) Jan 14
    to Diana Qu, David Pennington, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from David Pennington and Diana Qu

    Darryl James voted and added 1 comment

    Votes added by Darryl James

    Code-Review+0

    1 comment

    Patchset-level comments
    Darryl James . resolved

    Adding @dpenning as a secondary reviewer - feel free to pass along if you are aware of someone else with experience in this area

    Design document can be found here: https://docs.google.com/document/d/1P02yjuD-mbUNzFXZYJnMqhJM_ZuivHFVbvRPIB8rX-o/edit?tab=t.0#heading=h.7nki9mck5t64

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Diana Qu
    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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
    Gerrit-Change-Number: 7426191
    Gerrit-PatchSet: 4
    Gerrit-Owner: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Diana Qu <xi...@microsoft.com>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 01:15:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Darryl James (Gerrit)

    unread,
    Jan 14, 2026, 8:16:00 PM (yesterday) Jan 14
    to Diana Qu, David Pennington, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from David Pennington and Diana Qu

    Darryl James voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Diana Qu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
    Gerrit-Change-Number: 7426191
    Gerrit-PatchSet: 4
    Gerrit-Owner: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Diana Qu <xi...@microsoft.com>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 01:15:47 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Diana Qu (Gerrit)

    unread,
    Jan 14, 2026, 10:47:00 PM (22 hours ago) Jan 14
    to Liang Zhao, David Pennington, Darryl James, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from David Pennington and Liang Zhao

    Diana Qu added 3 comments

    Patchset-level comments
    Diana Qu . resolved

    Hi Liang~ Add you for a second eye on this as well.

    Darryl James . resolved

    Adding @dpenning as a secondary reviewer - feel free to pass along if you are aware of someone else with experience in this area

    Design document can be found here: https://docs.google.com/document/d/1P02yjuD-mbUNzFXZYJnMqhJM_ZuivHFVbvRPIB8rX-o/edit?tab=t.0#heading=h.7nki9mck5t64

    Diana Qu

    Thanks! I also add Liang from my team for another eye.

    File chrome/browser/ui/browser_commands.cc
    Line 934, Patchset 3: if (CanGoBackToOpener(web_contents)) {
    tabs::TabInterface* tab =
    tabs::TabInterface::MaybeGetFromContents(web_contents);
    Darryl James . resolved

    optional: It might be worth finding a way to only query for the tab and controller once. I noticed that CanGoBackToOpener and the code within this block re-query for the tab / controller.

    I don't believe this is an expensive operation so I am fine with this as is 👍

    Diana Qu

    I created another helper with different parameter!

    Darryl James

    Sweet!

    Because you have inverted the condition by checking the tab first you can also consider getting rid of the new function and inline the `controller && controller->CanGoBackToOpener` at the callsites if you wanted.

    Marking as resolved though since that is ultimately preference, nice work!

    Diana Qu

    Good note. I will make a note to myself and probably try to update this in part 4

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Liang Zhao
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
    Gerrit-Change-Number: 7426191
    Gerrit-PatchSet: 4
    Gerrit-Owner: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
    Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 03:46:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Diana Qu <xi...@microsoft.com>
    Comment-In-Reply-To: Darryl James <dlj...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Liang Zhao (Gerrit)

    unread,
    2:08 PM (7 hours ago) 2:08 PM
    to Diana Qu, David Pennington, Darryl James, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from David Pennington and Diana Qu

    Liang Zhao added 1 comment

    File chrome/browser/ui/browser_commands.cc
    Line 916, Patchset 4 (Latest): GoBack(GetTabAndRevertIfNecessary(browser, disposition));
    Liang Zhao . unresolved

    The existing code checks CanGoBack(browser) before calling GetTabAndRevertIfNecessary. If CanGoBack is false, the new code will revert omnibox edits while the old code does not change anything. Is it possible for this function to be called with CanGoBack as false?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Diana Qu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
      Gerrit-Change-Number: 7426191
      Gerrit-PatchSet: 4
      Gerrit-Owner: Diana Qu <xi...@microsoft.com>
      Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
      Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
      Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
      Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Diana Qu <xi...@microsoft.com>
      Gerrit-Attention: David Pennington <dpen...@chromium.org>
      Gerrit-Comment-Date: Thu, 15 Jan 2026 19:08:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Pennington (Gerrit)

      unread,
      4:43 PM (4 hours ago) 4:43 PM
      to Diana Qu, Liang Zhao, Darryl James, Chromium LUCI CQ, chromium...@chromium.org
      Attention needed from Diana Qu

      David Pennington voted and added 1 comment

      Votes added by David Pennington

      Code-Review+1

      1 comment

      Patchset-level comments
      David Pennington . resolved

      adding creis@ to review navigation code in the back_to_opener_controller.cc

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Diana Qu
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
        Gerrit-Change-Number: 7426191
        Gerrit-PatchSet: 4
        Gerrit-Owner: Diana Qu <xi...@microsoft.com>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
        Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
        Gerrit-Attention: Diana Qu <xi...@microsoft.com>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 21:43:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Diana Qu (Gerrit)

        unread,
        6:30 PM (2 hours ago) 6:30 PM
        to David Pennington, Liang Zhao, Darryl James, Chromium LUCI CQ, chromium...@chromium.org
        Attention needed from Liang Zhao

        Diana Qu added 1 comment

        File chrome/browser/ui/browser_commands.cc
        Line 916, Patchset 4 (Latest): GoBack(GetTabAndRevertIfNecessary(browser, disposition));
        Liang Zhao . unresolved

        The existing code checks CanGoBack(browser) before calling GetTabAndRevertIfNecessary. If CanGoBack is false, the new code will revert omnibox edits while the old code does not change anything. Is it possible for this function to be called with CanGoBack as false?

        Diana Qu

        The new code won't get called when CanGoBack is false. It will check on the normal CanGoBack first and then CanGoBackToOpener before trying to goback. If you think its a concern. I can add another test around omnibox cases.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Liang Zhao
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
        Gerrit-Change-Number: 7426191
        Gerrit-PatchSet: 4
        Gerrit-Owner: Diana Qu <xi...@microsoft.com>
        Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
        Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
        Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 23:30:10 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Liang Zhao (Gerrit)

        unread,
        7:29 PM (1 hour ago) 7:29 PM
        to Diana Qu, David Pennington, Darryl James, Chromium LUCI CQ, chromium...@chromium.org
        Attention needed from Diana Qu

        Liang Zhao voted and added 1 comment

        Votes added by Liang Zhao

        Code-Review+1

        1 comment

        File chrome/browser/ui/browser_commands.cc
        Line 916, Patchset 4 (Latest): GoBack(GetTabAndRevertIfNecessary(browser, disposition));
        Liang Zhao . resolved

        The existing code checks CanGoBack(browser) before calling GetTabAndRevertIfNecessary. If CanGoBack is false, the new code will revert omnibox edits while the old code does not change anything. Is it possible for this function to be called with CanGoBack as false?

        Diana Qu

        The new code won't get called when CanGoBack is false. It will check on the normal CanGoBack first and then CanGoBackToOpener before trying to goback. If you think its a concern. I can add another test around omnibox cases.

        Liang Zhao

        Looks like this is related to IDC_BACK, and there are code that update the command's enable state based on ShouldEnableBackButton(). So, it should not be called when CanGoBack is false. You could do some manual tests to confirm though: open a tab, type something in address bar and press Alt+<left-arrow> to see whether the address bar changes with your change.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Diana Qu
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I93ba8bf52d1005d076f6192666b8fcc84114c66d
          Gerrit-Change-Number: 7426191
          Gerrit-PatchSet: 4
          Gerrit-Owner: Diana Qu <xi...@microsoft.com>
          Gerrit-Reviewer: Darryl James <dlj...@chromium.org>
          Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
          Gerrit-Reviewer: Diana Qu <xi...@microsoft.com>
          Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
          Gerrit-Attention: Diana Qu <xi...@microsoft.com>
          Gerrit-Comment-Date: Fri, 16 Jan 2026 00:29:03 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Diana Qu <xi...@microsoft.com>
          Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages