Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed blank tab is shown after attaching split view #26994

Open
wants to merge 1 commit into
base: sko/split-view-refactor
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions browser/ui/views/split_view/split_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,12 @@ void SplitView::OnTileTabs(const TabTile& tile) {
UpdateContentsWebViewVisual();
}

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

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

void SplitView::OnSwapTabsInTile(const TabTile& tile) {
Expand Down
2 changes: 1 addition & 1 deletion browser/ui/views/split_view/split_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SplitView : public views::View, public SplitViewBrowserDataObserver {

// 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;

private:
Expand Down
3 changes: 1 addition & 2 deletions browser/ui/views/split_view/split_view_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
split_view_data->IsTabTiled(tab_strip_model().GetTabHandleAt(0)));

// Then, the secondary web view should become hidden
ASSERT_TRUE(base::test::RunUntil(
[&]() { return !secondary_contents_container().GetVisible(); }));
EXPECT_FALSE(secondary_contents_container().GetVisible());
}

IN_PROC_BROWSER_TEST_F(SplitViewBrowserTest,
Expand Down
Loading