Chromium changes:
https://chromium.googlesource.com/chromium/src/+/4650246ccb09055bd278e075fb26055343174087https://chromium.googlesource.com/chromium/src/+/830564b5f14f755a81fa9f9d5f1e171b568dfc6a
commit 4650246ccb09055bd278e075fb26055343174087
Author: Kun Wang <kunwang@microsoft.com>
Date: Tue Apr 14 20:46:35 2026 -0700
[bedrock] Remove FindAllTabbedBrowsersWithProfile() from BrowserFinder
Bug: 494010890
Change-Id: I7d237edf67693e11d23397813f06d4e32d27d5a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7738568
Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: Qikai Zhong <qikaizhong@microsoft.com>
Commit-Queue: Kun Wang <kunwang@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1614924}
commit 830564b5f14f755a81fa9f9d5f1e171b568dfc6a
Author: Yu He <yhe@microsoft.com>
Date: Thu Mar 19 12:08:13 2026 -0700
Reland "[bedrock] FindAllTabbedBrowsersWithProfile() function call point refactoring"
This is a reland of commit e1e46c26f73c2b52e384e7ea0b59d312ab6399c5
The original CL was reverted because it caused
ActorLoadAndExtractContentToolBrowserTest.WindowClosedPrematurely to
fail on linux-wayland-mutter-rel-tests.
Root cause: GetActiveWindowId() used ProfileBrowserCollection::ForEach()
with the default kCreation order. On Wayland, when a new browser window
is shown via BrowserView::Show(), DidBecomeActive() is called
synchronously for the new window, but DidBecomeInactive() for the
previous window only fires asynchronously when the compositor sends a
"lost focus" event. This means both windows can have IsActive()==true
simultaneously. With kCreation order, the older (wrong) window was found
first. The original FindAllTabbedBrowsersWithProfile() iterated in
activation order, so the most recently shown window was always checked
first.
Fix: Pass BrowserCollection::Order::kActivation to ForEach() in
GetActiveWindowId() to match the original iteration order.
Also re-enables the WindowClosedPrematurely test on Linux, which was
disabled by a gardener after the original CL landed.
Patchset 3 fixes the issue and has been verified locally by running the
test 50 times under mutter/Wayland without failure.
Original change's description:
> [bedrock] FindAllTabbedBrowsersWithProfile() function call point refactoring
>
> Migrate all non-test call sites of FindAllTabbedBrowsersWithProfile()
> from Browser* to BrowserWindowInterface*, adapting downstream method
> calls accordingly.
>
> Call sites migrated:
> - actor_proto_conversion.cc: session_id() → GetSessionID()
> - load_and_extract_content_tool_request.cc: session_id() → GetSessionID()
> - tab_sensitivity_cache.cc: tab_strip_model() → GetTabStripModel()
>
> The function still returns std::vector<Browser*>; each call site uses
> BrowserWindowInterface* as the range-based for loop variable, relying
> on the implicit upcast from Browser* to BrowserWindowInterface*.
>
> Bug: 431671320
> Change-Id: Ie621746798e54642981b5d2330a653a5f2501821
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7665417
> Auto-Submit: Yu He <yhe@microsoft.com>
> Reviewed-by: Qikai Zhong <qikaizhong@microsoft.com>
> Reviewed-by: Tom Lukaszewicz <tluk@chromium.org>
> Commit-Queue: Qikai Zhong <qikaizhong@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#1600308}
Bug: 431671320
Change-Id: I35bd2cc00fc4411c61570be4b906dc3b4dab5dba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7678191
Reviewed-by: Qikai Zhong <qikaizhong@microsoft.com>
Commit-Queue: Tom Lukaszewicz <tluk@chromium.org>
Reviewed-by: Tom Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1602148}