diff options
author | pkotwicz <pkotwicz@chromium.org> | 2014-09-21 21:13:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-22 04:14:07 +0000 |
commit | b1400bfbfb079bf3dfeb9de9d58f651059f98e1b (patch) | |
tree | e08de3eaa62a746824919a16bcda8fbb51cdcab6 /apps | |
parent | 49ce0fa0fdef9a601026c0b817330e07705b6841 (diff) | |
download | chromium_src-b1400bfbfb079bf3dfeb9de9d58f651059f98e1b.zip chromium_src-b1400bfbfb079bf3dfeb9de9d58f651059f98e1b.tar.gz chromium_src-b1400bfbfb079bf3dfeb9de9d58f651059f98e1b.tar.bz2 |
Disables the maximize button for an app window with a maximum size and a custom frame color
BUG=416214
TEST=Manual, see bug
Review URL: https://codereview.chromium.org/588873002
Cr-Commit-Position: refs/heads/master@{#295922}
Diffstat (limited to 'apps')
-rw-r--r-- | apps/ui/views/app_window_frame_view.cc | 13 | ||||
-rw-r--r-- | apps/ui/views/app_window_frame_view.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/apps/ui/views/app_window_frame_view.cc b/apps/ui/views/app_window_frame_view.cc index fe57225..e706af2 100644 --- a/apps/ui/views/app_window_frame_view.cc +++ b/apps/ui/views/app_window_frame_view.cc @@ -229,6 +229,13 @@ void AppWindowFrameView::GetWindowMask(const gfx::Size& size, // We got nothing to say about no window mask. } +void AppWindowFrameView::SizeConstraintsChanged() { + if (draw_frame_) { + maximize_button_->SetEnabled(widget_->widget_delegate() && + widget_->widget_delegate()->CanMaximize()); + } +} + gfx::Size AppWindowFrameView::GetPreferredSize() const { gfx::Size pref = widget_->client_view()->GetPreferredSize(); gfx::Rect bounds(0, 0, pref.width(), pref.height()); @@ -250,10 +257,8 @@ void AppWindowFrameView::Layout() { close_size.width(), close_size.height()); - bool can_ever_resize = widget_->widget_delegate() - ? widget_->widget_delegate()->CanResize() - : false; - maximize_button_->SetEnabled(can_ever_resize); + maximize_button_->SetEnabled(widget_->widget_delegate() && + widget_->widget_delegate()->CanMaximize()); gfx::Size maximize_size = maximize_button_->GetPreferredSize(); maximize_button_->SetBounds( close_button_->x() - kButtonSpacing - maximize_size.width(), diff --git a/apps/ui/views/app_window_frame_view.h b/apps/ui/views/app_window_frame_view.h index 43c4d64..7ab2d4c 100644 --- a/apps/ui/views/app_window_frame_view.h +++ b/apps/ui/views/app_window_frame_view.h @@ -77,7 +77,7 @@ class AppWindowFrameView : public views::NonClientFrameView, virtual void ResetWindowControls() OVERRIDE {} virtual void UpdateWindowIcon() OVERRIDE {} virtual void UpdateWindowTitle() OVERRIDE {} - virtual void SizeConstraintsChanged() OVERRIDE {} + virtual void SizeConstraintsChanged() OVERRIDE; // views::View implementation. virtual gfx::Size GetPreferredSize() const OVERRIDE; |