Skip to content

Commit

Permalink
Merge pull request #26994 from brave/fix_blank_tab_after_attaching_sp…
Browse files Browse the repository at this point in the history
…lit_view

Fixed blank tab is shown after attaching split view
  • Loading branch information
simonhong authored Jan 8, 2025
2 parents d14ca67 + 1932bad commit 97b20a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions browser/ui/views/frame/brave_browser_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -856,14 +856,12 @@ void BraveBrowserView::OnTileTabs(const TabTile& tile) {
UpdateContentsWebViewVisual();
}

void BraveBrowserView::OnWillBreakTile(const TabTile& tile) {
void BraveBrowserView::OnDidBreakTile(const TabTile& tile) {
if (!IsActiveWebContentsTiled(tile)) {
return;
}

base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&BraveBrowserView::UpdateContentsWebViewVisual,
weak_ptr_.GetWeakPtr()));
UpdateContentsWebViewVisual();
}

void BraveBrowserView::OnSwapTabsInTile(const TabTile& tile) {
Expand Down
2 changes: 1 addition & 1 deletion browser/ui/views/frame/brave_browser_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class BraveBrowserView : public BrowserView,

// SplitViewBrowserDataObserver:
void OnTileTabs(const TabTile& tile) override;
void OnWillBreakTile(const TabTile& tile) override;
void OnDidBreakTile(const TabTile& tile) override;
void OnSwapTabsInTile(const TabTile& tile) override;

views::WebView* secondary_contents_web_view() {
Expand Down
1 change: 0 additions & 1 deletion browser/ui/views/frame/split_view_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));

// Then, the secondary web view should become hidden
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(secondary_contents_view().GetVisible());
}

Expand Down

0 comments on commit 97b20a2

Please sign in to comment.