[bedrock] Migrate FindBrowserWithActiveWindow() To GBC [chromium/src : main]

2 views
Skip to first unread message

Tom Lukaszewicz (Gerrit)

unread,
Apr 9, 2026, 1:21:43 AMApr 9
to Kun Wang, Hidehiko Abe, Chromium LUCI CQ, Qikai Zhong, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
Attention needed from Hidehiko Abe, Kun Wang and Qikai Zhong

Tom Lukaszewicz added 2 comments

Patchset-level comments
File-level comment, Patchset 12 (Latest):
Tom Lukaszewicz . resolved

Overall looks good - just a comment on the collection method impl. Hihdehiko could you ptal for chromeos also?

File chrome/browser/ui/browser_window/internal/global_browser_collection.cc
Line 90, Patchset 12 (Latest): return (browser && browser->IsActive()) ? browser : nullptr;
Tom Lukaszewicz . unresolved

This should be `browser->GetWindow()->IsActive()` to match the impl in [browser_finder](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_finder.cc) (which I believe will address the broken tests).

I also believe `BWI::GetWindow` and `BaseWindow::IsActive()` is available on android so we can drop the build-guards.

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
  • Kun Wang
  • Qikai Zhong
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: I2f911b4884c2f69245a6e78d672abe142110d20c
Gerrit-Change-Number: 7735246
Gerrit-PatchSet: 12
Gerrit-Owner: Kun Wang <kun...@microsoft.com>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
Gerrit-Attention: Kun Wang <kun...@microsoft.com>
Gerrit-Attention: Qikai Zhong <qikai...@microsoft.com>
Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Apr 2026 05:21:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kun Wang (Gerrit)

unread,
Apr 9, 2026, 4:17:30 AMApr 9
to Hidehiko Abe, Chromium LUCI CQ, Qikai Zhong, Tom Lukaszewicz, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
Attention needed from Hidehiko Abe, Qikai Zhong and Tom Lukaszewicz

Kun Wang voted and added 1 comment

Votes added by Kun Wang

Commit-Queue+1

1 comment

File chrome/browser/ui/browser_window/internal/global_browser_collection.cc
Line 90, Patchset 12: return (browser && browser->IsActive()) ? browser : nullptr;
Tom Lukaszewicz . resolved

This should be `browser->GetWindow()->IsActive()` to match the impl in [browser_finder](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_finder.cc) (which I believe will address the broken tests).

I also believe `BWI::GetWindow` and `BaseWindow::IsActive()` is available on android so we can drop the build-guards.

Kun Wang

Thanks, you are correct. I've fixed this.

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
  • Qikai Zhong
  • Tom 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: I2f911b4884c2f69245a6e78d672abe142110d20c
    Gerrit-Change-Number: 7735246
    Gerrit-PatchSet: 13
    Gerrit-Owner: Kun Wang <kun...@microsoft.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
    Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
    Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
    Gerrit-Attention: Qikai Zhong <qikai...@microsoft.com>
    Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Thu, 09 Apr 2026 08:16:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Tom Lukaszewicz <tl...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Qikai Zhong (Gerrit)

    unread,
    Apr 9, 2026, 5:08:10 AMApr 9
    to Kun Wang, Hidehiko Abe, Chromium LUCI CQ, Tom Lukaszewicz, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
    Attention needed from Hidehiko Abe, Kun Wang and Tom Lukaszewicz

    Qikai Zhong added 1 comment

    File chrome/browser/password_manager/web_app_profile_switcher_interactive_uitest.cc
    Line 58, Patchset 13 (Latest):size_t GetTabbedBrowserCount(Profile* profile) {
    size_t count = 0;
    ProfileBrowserCollection::GetForProfile(profile)->ForEach(
    [&](BrowserWindowInterface* browser) {
    if (browser->GetType() == BrowserWindowInterface::TYPE_NORMAL) {
    count++;
    }
    return true;
    });
    return count;
    }
    Qikai Zhong . unresolved

    If this change is unnecessary, it can be split into another CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Kun Wang
    • Tom 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: I2f911b4884c2f69245a6e78d672abe142110d20c
      Gerrit-Change-Number: 7735246
      Gerrit-PatchSet: 13
      Gerrit-Owner: Kun Wang <kun...@microsoft.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
      Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
      Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Attention: Kun Wang <kun...@microsoft.com>
      Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Thu, 09 Apr 2026 09:07:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kun Wang (Gerrit)

      unread,
      Apr 9, 2026, 7:23:53 AMApr 9
      to Hidehiko Abe, Chromium LUCI CQ, Qikai Zhong, Tom Lukaszewicz, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
      Attention needed from Hidehiko Abe, Qikai Zhong and Tom Lukaszewicz

      Kun Wang voted and added 1 comment

      Votes added by Kun Wang

      Commit-Queue+1

      1 comment

      File chrome/browser/password_manager/web_app_profile_switcher_interactive_uitest.cc
      Line 58, Patchset 13:size_t GetTabbedBrowserCount(Profile* profile) {

      size_t count = 0;
      ProfileBrowserCollection::GetForProfile(profile)->ForEach(
      [&](BrowserWindowInterface* browser) {
      if (browser->GetType() == BrowserWindowInterface::TYPE_NORMAL) {
      count++;
      }
      return true;
      });
      return count;
      }
      Qikai Zhong . resolved

      If this change is unnecessary, it can be split into another CL.

      Kun Wang

      Oh Thanks. You are right, this change should be in another CL.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Qikai Zhong
      • Tom 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: I2f911b4884c2f69245a6e78d672abe142110d20c
        Gerrit-Change-Number: 7735246
        Gerrit-PatchSet: 14
        Gerrit-Owner: Kun Wang <kun...@microsoft.com>
        Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
        Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
        Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Attention: Qikai Zhong <qikai...@microsoft.com>
        Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
        Gerrit-Comment-Date: Thu, 09 Apr 2026 11:23:21 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Qikai Zhong <qikai...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Hidehiko Abe (Gerrit)

        unread,
        Apr 9, 2026, 1:08:53 PMApr 9
        to Kun Wang, Chromium LUCI CQ, Qikai Zhong, Tom Lukaszewicz, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
        Attention needed from Kun Wang, Qikai Zhong and Tom Lukaszewicz

        Hidehiko Abe voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kun Wang
        • Qikai Zhong
        • Tom Lukaszewicz
        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: I2f911b4884c2f69245a6e78d672abe142110d20c
        Gerrit-Change-Number: 7735246
        Gerrit-PatchSet: 14
        Gerrit-Owner: Kun Wang <kun...@microsoft.com>
        Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
        Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
        Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
        Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Attention: Kun Wang <kun...@microsoft.com>
        Gerrit-Attention: Qikai Zhong <qikai...@microsoft.com>
        Gerrit-Attention: Tom Lukaszewicz <tl...@chromium.org>
        Gerrit-Comment-Date: Thu, 09 Apr 2026 17:08:02 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Tom Lukaszewicz (Gerrit)

        unread,
        Apr 9, 2026, 2:34:49 PMApr 9
        to Kun Wang, Hidehiko Abe, Chromium LUCI CQ, Qikai Zhong, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
        Attention needed from Kun Wang and Qikai Zhong

        Tom Lukaszewicz voted and added 1 comment

        Votes added by Tom Lukaszewicz

        Code-Review+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 14 (Latest):
        Tom Lukaszewicz . resolved

        Thanks - lgtm!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kun Wang
        • Qikai Zhong
        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: I2f911b4884c2f69245a6e78d672abe142110d20c
          Gerrit-Change-Number: 7735246
          Gerrit-PatchSet: 14
          Gerrit-Owner: Kun Wang <kun...@microsoft.com>
          Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
          Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
          Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
          Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
          Gerrit-Attention: Kun Wang <kun...@microsoft.com>
          Gerrit-Attention: Qikai Zhong <qikai...@microsoft.com>
          Gerrit-Comment-Date: Thu, 09 Apr 2026 18:34:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Tom Lukaszewicz (Gerrit)

          unread,
          Apr 9, 2026, 2:35:01 PMApr 9
          to Kun Wang, Hidehiko Abe, Chromium LUCI CQ, Qikai Zhong, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org
          Attention needed from Kun Wang and Qikai Zhong

          Tom Lukaszewicz voted Commit-Queue+2

          Commit-Queue+2
          Gerrit-Comment-Date: Thu, 09 Apr 2026 18:34:29 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          Apr 9, 2026, 2:51:12 PMApr 9
          to Kun Wang, Tom Lukaszewicz, Hidehiko Abe, Qikai Zhong, AyeAye, chromium...@chromium.org, armalhotra+a...@google.com, ayman...@chromium.org, chrome-gr...@chromium.org, cros-essential...@chromium.org, feature-me...@chromium.org, gcasto+w...@chromium.org, grt+...@chromium.org, mac-r...@chromium.org, mdjone...@chromium.org, osaul+aut...@google.com, shgar+aut...@google.com, siashah+au...@chromium.org, siyua+aut...@chromium.org, vasilii+watchlis...@chromium.org, vinnypersky+...@google.com, yuezhang...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          [bedrock] Migrate FindBrowserWithActiveWindow() To GBC
          Bug: 494010890
          Change-Id: I2f911b4884c2f69245a6e78d672abe142110d20c
          Reviewed-by: Tom Lukaszewicz <tl...@chromium.org>
          Reviewed-by: Hidehiko Abe <hide...@chromium.org>
          Commit-Queue: Tom Lukaszewicz <tl...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1612404}
          Files:
          • M chrome/browser/ash/system_web_apps/apps/DEPS
          • M chrome/browser/ash/system_web_apps/apps/media_app/media_app_integration_browsertest.cc
          • M chrome/browser/ash/system_web_apps/apps/media_app/media_app_ocr_integration_browsertest.cc
          • M chrome/browser/password_manager/web_app_profile_switcher_interactive_uitest.cc
          • M chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
          • M chrome/browser/ui/ash/multi_user/multi_user_window_manager_browser_adaptor_unittest.cc
          • M chrome/browser/ui/ash/new_window/DEPS
          • M chrome/browser/ui/ash/new_window/chrome_new_window_client.cc
          • M chrome/browser/ui/ash/projector/DEPS
          • M chrome/browser/ui/ash/projector/screencast_manager_browsertest.cc
          • M chrome/browser/ui/autofill/payments/filled_card_information_bubble_controller_impl.cc
          • M chrome/browser/ui/autofill/payments/offer_notification_bubble_controller_impl.cc
          • M chrome/browser/ui/autofill/payments/virtual_card_enroll_bubble_controller_impl.cc
          • M chrome/browser/ui/browser_window/internal/global_browser_collection.cc
          • M chrome/browser/ui/browser_window/public/global_browser_collection.h
          • M chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
          • M chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_interactive_uitest.cc
          • M chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_platform_impl_desktop.cc
          • M chrome/browser/ui/webui/commerce/shopping_ui_handler_delegate.cc
          Change size: M
          Delta: 19 files changed, 112 insertions(+), 56 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Tom Lukaszewicz, +1 by Hidehiko Abe
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I2f911b4884c2f69245a6e78d672abe142110d20c
          Gerrit-Change-Number: 7735246
          Gerrit-PatchSet: 15
          Gerrit-Owner: Kun Wang <kun...@microsoft.com>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
          Gerrit-Reviewer: Kun Wang <kun...@microsoft.com>
          Gerrit-Reviewer: Qikai Zhong <qikai...@microsoft.com>
          Gerrit-Reviewer: Tom Lukaszewicz <tl...@chromium.org>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages