Skip to content

Commit 3ac59a6

Browse files
sonkkeliChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
borderless: Pass IsBorderlessModeEnabled to opaque's layout delegate
Bug: 1325830 Change-Id: I664bc5998240ffa7698cc544ab4402899fc3911b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4196876 Reviewed-by: Christian Flach <cmfcmf@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Commit-Queue: Sonja Laurila <laurila@google.com> Cr-Commit-Position: refs/heads/main@{#1097615}
1 parent 83947dd commit 3ac59a6

9 files changed

+15
-0
lines changed

chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native_unittest.cc

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class TestLayoutDelegate : public OpaqueBrowserFrameViewLayoutDelegate {
6565
bool IsMinimized() const override { return false; }
6666
bool IsFullscreen() const override { return false; }
6767
bool IsTabStripVisible() const override { return true; }
68+
bool GetBorderlessModeEnabled() const override { return false; }
6869
int GetTabStripHeight() const override {
6970
return GetLayoutConstant(TAB_HEIGHT);
7071
}

chrome/browser/ui/views/frame/browser_frame_view_layout_linux_unittest.cc

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class TestLayoutDelegate : public OpaqueBrowserFrameViewLayoutDelegate {
3434
bool IsMinimized() const override { return false; }
3535
bool IsFullscreen() const override { return false; }
3636
bool IsTabStripVisible() const override { return true; }
37+
bool GetBorderlessModeEnabled() const override { return false; }
3738
int GetTabStripHeight() const override {
3839
return GetLayoutConstant(TAB_HEIGHT);
3940
}

chrome/browser/ui/views/frame/browser_view.cc

+4
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
546546
return browser_view_->GetTabStripVisible();
547547
}
548548

549+
bool GetBorderlessModeEnabled() const override {
550+
return browser_view_->IsBorderlessModeEnabled();
551+
}
552+
549553
gfx::Rect GetBoundsForTabStripRegionInBrowserView() const override {
550554
const gfx::Size tabstrip_minimum_size =
551555
browser_view_->tab_strip_region_view()->GetMinimumSize();

chrome/browser/ui/views/frame/browser_view_layout_delegate.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class BrowserViewLayoutDelegate {
2121
virtual ~BrowserViewLayoutDelegate() {}
2222

2323
virtual bool IsTabStripVisible() const = 0;
24+
virtual bool GetBorderlessModeEnabled() const = 0;
2425
virtual gfx::Rect GetBoundsForTabStripRegionInBrowserView() const = 0;
2526
virtual int GetTopInsetInBrowserView() const = 0;
2627
virtual int GetThemeBackgroundXInset() const = 0;

chrome/browser/ui/views/frame/browser_view_layout_unittest.cc

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class MockBrowserViewLayoutDelegate : public BrowserViewLayoutDelegate {
6060

6161
// BrowserViewLayout::Delegate overrides:
6262
bool IsTabStripVisible() const override { return tab_strip_visible_; }
63+
bool GetBorderlessModeEnabled() const override { return false; }
6364
gfx::Rect GetBoundsForTabStripRegionInBrowserView() const override {
6465
return gfx::Rect();
6566
}

chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ bool OpaqueBrowserFrameView::IsTabStripVisible() const {
511511
return browser_view()->GetTabStripVisible();
512512
}
513513

514+
bool OpaqueBrowserFrameView::GetBorderlessModeEnabled() const {
515+
return browser_view()->IsBorderlessModeEnabled();
516+
}
517+
514518
bool OpaqueBrowserFrameView::IsToolbarVisible() const {
515519
return browser_view()->IsToolbarVisible() &&
516520
!browser_view()->toolbar()->GetPreferredSize().IsEmpty();

chrome/browser/ui/views/frame/opaque_browser_frame_view.h

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
100100
bool IsMinimized() const override;
101101
bool IsFullscreen() const override;
102102
bool IsTabStripVisible() const override;
103+
bool GetBorderlessModeEnabled() const override;
103104
int GetTabStripHeight() const override;
104105
bool IsToolbarVisible() const override;
105106
gfx::Size GetTabstripMinimumSize() const override;

chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class OpaqueBrowserFrameViewLayoutDelegate {
5959
virtual bool IsMaximized() const = 0;
6060
virtual bool IsMinimized() const = 0;
6161
virtual bool IsFullscreen() const = 0;
62+
virtual bool GetBorderlessModeEnabled() const = 0;
6263

6364
virtual bool IsTabStripVisible() const = 0;
6465
virtual int GetTabStripHeight() const = 0;

chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class TestLayoutDelegate : public OpaqueBrowserFrameViewLayoutDelegate {
7575
bool IsMinimized() const override { return false; }
7676
bool IsFullscreen() const override { return false; }
7777
bool IsTabStripVisible() const override { return window_title_.empty(); }
78+
bool GetBorderlessModeEnabled() const override { return false; }
7879
int GetTabStripHeight() const override {
7980
return IsTabStripVisible() ? GetLayoutConstant(TAB_HEIGHT) : 0;
8081
}

0 commit comments

Comments
 (0)