| Index: ui/views/window/custom_frame_view.cc
|
| diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc
|
| index 9ee05107d2a70a5a1874ecfa8d1baf147b89f083..cc758ee5b4b8726cab8332ee57663dedb2f6c460 100644
|
| --- a/ui/views/window/custom_frame_view.cc
|
| +++ b/ui/views/window/custom_frame_view.cc
|
| @@ -89,7 +89,6 @@ CustomFrameView::CustomFrameView()
|
| maximize_button_(NULL),
|
| restore_button_(NULL),
|
| close_button_(NULL),
|
| - should_show_maximize_button_(false),
|
| frame_background_(new FrameBackground()),
|
| minimum_title_bar_x_(0),
|
| maximum_title_bar_x_(-1) {
|
| @@ -110,8 +109,6 @@ void CustomFrameView::Init(Widget* frame) {
|
| restore_button_ = InitWindowCaptionButton(IDS_APP_ACCNAME_RESTORE,
|
| IDR_RESTORE, IDR_RESTORE_H, IDR_RESTORE_P);
|
|
|
| - should_show_maximize_button_ = frame_->widget_delegate()->CanMaximize();
|
| -
|
| if (frame_->widget_delegate()->ShouldShowWindowIcon()) {
|
| window_icon_ = new ImageButton(this);
|
| AddChildView(window_icon_);
|
| @@ -189,6 +186,8 @@ void CustomFrameView::ResetWindowControls() {
|
| minimize_button_->SetState(CustomButton::STATE_NORMAL);
|
| maximize_button_->SetState(CustomButton::STATE_NORMAL);
|
| // The close button isn't affected by this constraint.
|
| +
|
| + LayoutWindowControls();
|
| }
|
|
|
| void CustomFrameView::UpdateWindowIcon() {
|
| @@ -602,13 +601,14 @@ ImageButton* CustomFrameView::GetImageButton(views::FrameButton frame_button) {
|
| case views::FRAME_BUTTON_MAXIMIZE: {
|
| bool is_restored = !frame_->IsMaximized() && !frame_->IsMinimized();
|
| button = is_restored ? maximize_button_ : restore_button_;
|
| - if (!should_show_maximize_button_) {
|
| - // If we should not show the maximize/restore button, then we return
|
| - // NULL as we don't want this button to become visible and to be laid
|
| - // out.
|
| - button->SetVisible(false);
|
| + // If we should not show the maximize/restore button, then we return
|
| + // NULL as we don't want this button to become visible and to be laid
|
| + // out.
|
| + bool should_show = frame_->widget_delegate()->CanMaximize();
|
| + button->SetVisible(should_show);
|
| + if (!should_show)
|
| return NULL;
|
| - }
|
| +
|
| break;
|
| }
|
| case views::FRAME_BUTTON_CLOSE: {
|
|
|