Commit 87343874 authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Remove restore button in tablet mode on Windows.

Tablet mode has no restore functionality since all windows are
effectively "maximized" even in split-screen mode.

Bug: 1111019
Change-Id: I397c6a66cc9c337d0bb8e04e33bf8e4a44153d2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327645Reviewed-by: default avatarCollin Baker <collinbaker@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792917}
parent fb67134b
...@@ -107,8 +107,15 @@ void GlassBrowserCaptionButtonContainer::OnWidgetBoundsChanged( ...@@ -107,8 +107,15 @@ void GlassBrowserCaptionButtonContainer::OnWidgetBoundsChanged(
} }
void GlassBrowserCaptionButtonContainer::UpdateButtonVisibility() { void GlassBrowserCaptionButtonContainer::UpdateButtonVisibility() {
const bool is_maximized = frame_view_->IsMaximized(); if (frame_view_->IsWebUITabStrip()) {
restore_button_->SetVisible(is_maximized); // In tablet mode, all windows are effectively full-screen and cannot be
maximize_button_->SetVisible(!is_maximized); // restored, so don't show either button.
restore_button_->SetVisible(false);
maximize_button_->SetVisible(false);
} else {
const bool is_maximized = frame_view_->IsMaximized();
restore_button_->SetVisible(is_maximized);
maximize_button_->SetVisible(!is_maximized);
}
InvalidateLayout(); InvalidateLayout();
} }
...@@ -389,6 +389,11 @@ bool GlassBrowserFrameView::IsMaximized() const { ...@@ -389,6 +389,11 @@ bool GlassBrowserFrameView::IsMaximized() const {
return frame()->IsMaximized(); return frame()->IsMaximized();
} }
bool GlassBrowserFrameView::IsWebUITabStrip() const {
return WebUITabStripContainerView::UseTouchableTabStrip(
browser_view()->browser());
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// GlassBrowserFrameView, views::View overrides: // GlassBrowserFrameView, views::View overrides:
...@@ -552,11 +557,6 @@ bool GlassBrowserFrameView::ShowSystemIcon() const { ...@@ -552,11 +557,6 @@ bool GlassBrowserFrameView::ShowSystemIcon() const {
browser_view()->ShouldShowWindowIcon(); browser_view()->ShouldShowWindowIcon();
} }
bool GlassBrowserFrameView::IsWebUITabStrip() const {
return WebUITabStripContainerView::UseTouchableTabStrip(
browser_view()->browser());
}
bool GlassBrowserFrameView::OwnsCaptionButtons() const { bool GlassBrowserFrameView::OwnsCaptionButtons() const {
return caption_button_container_ && return caption_button_container_ &&
caption_button_container_->parent() == this; caption_button_container_->parent() == this;
......
...@@ -66,6 +66,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView, ...@@ -66,6 +66,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
gfx::ImageSkia GetFaviconForTabIconView() override; gfx::ImageSkia GetFaviconForTabIconView() override;
bool IsMaximized() const; bool IsMaximized() const;
bool IsWebUITabStrip() const;
// Visual height of the titlebar when the window is maximized (i.e. excluding // Visual height of the titlebar when the window is maximized (i.e. excluding
// the area above the top of the screen). // the area above the top of the screen).
...@@ -122,7 +123,6 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView, ...@@ -122,7 +123,6 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
bool ShowCustomIcon() const; bool ShowCustomIcon() const;
bool ShowCustomTitle() const; bool ShowCustomTitle() const;
bool ShowSystemIcon() const; bool ShowSystemIcon() const;
bool IsWebUITabStrip() const;
// Returns true if caption buttons are present on the frame (as opposed to // Returns true if caption buttons are present on the frame (as opposed to
// somewhere else, or not present at all). In some modes, the frame can "lend" // somewhere else, or not present at all). In some modes, the frame can "lend"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment