[cr148][Android] MultiInstanceOrchestratorImpl.moveTabsToWindowByIdChecked signature changed

New arg bringToFront

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/15b60a7f51080d75b18d37f6bbf83a7a39151c15

commit 15b60a7f51080d75b18d37f6bbf83a7a39151c15
Author: Lijin Shen <lazzzis@google.com>
Date:   Fri Mar 27 14:06:30 2026 -0700

    tabs.move on Android: allow moving tabs in the background

    Fixes a behavior discrepancy between Android and Desktop when moving
    tabs between windows via the extension API (e.g., chrome.tabs.move).
    Currently on Android, the destination window is always brought to the
    front

    Added a bringToFront boolean parameter to conditionally controls the
    call to ApiCompatibilityUtils.moveTaskToFront(). This defaults to true
    such that this CL won't bring any behavior change. This sets false in
    TabModelSelectorImpl.java such that tab.move won't activate the
    destination window.

    Bug: 495516043
    Change-Id: I60e7b42794c240023669afcf3cd15f8031c16ded
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7685707
    Reviewed-by: Linyu He <linyuh@google.com>
    Reviewed-by: Aishwarya Rajesh <aishwaryarj@google.com>
    Commit-Queue: Lijin Shen <lazzzis@google.com>
    Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1606471}
This commit is contained in:
AlexeyBarabash
2026-04-27 12:00:56 +01:00
committed by Claudio DeSouza
parent 0bad49cb8e
commit 727a295757
2 changed files with 13 additions and 4 deletions
@@ -75,7 +75,11 @@ class BraveMultiInstanceManagerApi31 extends MultiInstanceManagerApi31 {
}
public void moveTabsToWindowByIdChecked(
int destWindowId, List<Tab> tabs, int destTabIndex, int destGroupTabId) {
int destWindowId,
List<Tab> tabs,
int destTabIndex,
int destGroupTabId,
boolean bringToFront) {
if (mIsMoveTabsFromSettings && !tabs.isEmpty()) {
mIsMoveTabsFromSettings = false;
TabModelSelector selector =
@@ -25,12 +25,17 @@ public class BraveMultiInstanceOrchestratorImpl extends MultiInstanceOrchestrato
@Override
public void moveTabsToWindowByIdChecked(
int destWindowId, List<Tab> tabs, int destTabIndex, int destGroupTabId) {
super.moveTabsToWindowByIdChecked(destWindowId, tabs, destTabIndex, destGroupTabId);
int destWindowId,
List<Tab> tabs,
int destTabIndex,
int destGroupTabId,
boolean bringToFront) {
super.moveTabsToWindowByIdChecked(
destWindowId, tabs, destTabIndex, destGroupTabId, bringToFront);
if (mBraveMultiInstanceManager != null) {
mBraveMultiInstanceManager.moveTabsToWindowByIdChecked(
destWindowId, tabs, destTabIndex, destGroupTabId);
destWindowId, tabs, destTabIndex, destGroupTabId, bringToFront);
}
}
}