Skip to content

Commit 6a81a42

Browse files
committed
Create NTP tab when split view is created with active tab
fix brave/brave-browser#46191 Uptream loads split view specific page when createing another tab. We want to load NTP instead. TEST=SplitViewLocationBarBrowserTest.URLShouldBeUpdated_WhenActiveTabChanges 1. launch browser with --enable-features=SideBySide 2. Select "Add tab to split view" from active tab's context menu 3. Check NTP is loaded in newly created tab
1 parent 7d94a9e commit 6a81a42

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

browser/ui/views/split_view/split_view_location_bar_browsertest.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,6 @@ IN_PROC_BROWSER_TEST_P(SplitViewLocationBarBrowserTest,
134134
tab_strip_model().GetWebContentsAt(0)->GetVisibleURL().spec());
135135
ASSERT_EQ(u"about:blank", split_view_location_bar().url_->GetText());
136136

137-
// For now upstream's another page is loaded when split view is created
138-
// with active tab. So, loaded newtab to use below url check.
139-
if (IsSideBySideEnabled()) {
140-
ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition(
141-
browser(), GURL("chrome://newtab/"), WindowOpenDisposition::CURRENT_TAB,
142-
ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP));
143-
}
144-
145137
// When activating another tab in split view,
146138
tab_strip_model().ActivateTabAt(0);
147139

chromium_src/chrome/browser/ui/browser_commands.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
#include "brave/components/commander/common/buildflags/buildflags.h"
99
#include "chrome/browser/profiles/profile.h"
1010
#include "chrome/browser/ui/browser_commands.h"
11+
#include "chrome/common/webui_url_constants.h"
1112

1213
#define ReloadBypassingCache ReloadBypassingCache_ChromiumImpl
1314
#define GetReadingListModel GetReadingListModel_ChromiumImpl
15+
#define kChromeUISplitViewNewTabPageURL kChromeUINewTabURL
1416
#include "src/chrome/browser/ui/browser_commands.cc"
17+
#undef kChromeUISplitViewNewTabPageURL
1518
#undef ReloadBypassingCache
1619
#undef GetReadingListModel
1720

0 commit comments

Comments
 (0)