Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: ash/frame/custom_frame_view_ash.cc

Issue 583603004: Add CanMinimize to classes that implement WidgetDelegate::CanMaximize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@win_resizable
Patch Set: Add TODO. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/frame/custom_frame_view_ash.h" 5 #include "ash/frame/custom_frame_view_ash.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 DISALLOW_COPY_AND_ASSIGN(HeaderView); 196 DISALLOW_COPY_AND_ASSIGN(HeaderView);
197 }; 197 };
198 198
199 CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame) 199 CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame)
200 : frame_(frame), 200 : frame_(frame),
201 header_painter_(new ash::DefaultHeaderPainter), 201 header_painter_(new ash::DefaultHeaderPainter),
202 avatar_icon_(NULL), 202 avatar_icon_(NULL),
203 caption_button_container_(NULL), 203 caption_button_container_(NULL),
204 fullscreen_visible_fraction_(0) { 204 fullscreen_visible_fraction_(0) {
205 // Unfortunately, there is no views::WidgetDelegate::CanMinimize(). Assume
206 // that the window frame can be minimized if it can be maximized.
207 FrameCaptionButtonContainerView::MinimizeAllowed minimize_allowed = 205 FrameCaptionButtonContainerView::MinimizeAllowed minimize_allowed =
208 frame_->widget_delegate()->CanMaximize() ? 206 frame_->widget_delegate()->CanMinimize() ?
209 FrameCaptionButtonContainerView::MINIMIZE_ALLOWED : 207 FrameCaptionButtonContainerView::MINIMIZE_ALLOWED :
210 FrameCaptionButtonContainerView::MINIMIZE_DISALLOWED; 208 FrameCaptionButtonContainerView::MINIMIZE_DISALLOWED;
211 caption_button_container_ = new FrameCaptionButtonContainerView(frame_, 209 caption_button_container_ = new FrameCaptionButtonContainerView(frame_,
212 minimize_allowed); 210 minimize_allowed);
213 caption_button_container_->UpdateSizeButtonVisibility(); 211 caption_button_container_->UpdateSizeButtonVisibility();
214 AddChildView(caption_button_container_); 212 AddChildView(caption_button_container_);
215 213
216 header_painter_->Init(frame_, this, caption_button_container_); 214 header_painter_->Init(frame_, this, caption_button_container_);
217 UpdateAvatarIcon(); 215 UpdateAvatarIcon();
218 216
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 FrameCaptionButtonContainerView* CustomFrameViewAsh:: 578 FrameCaptionButtonContainerView* CustomFrameViewAsh::
581 GetFrameCaptionButtonContainerViewForTest() { 579 GetFrameCaptionButtonContainerViewForTest() {
582 return header_view_->caption_button_container(); 580 return header_view_->caption_button_container();
583 } 581 }
584 582
585 int CustomFrameViewAsh::NonClientTopBorderHeight() const { 583 int CustomFrameViewAsh::NonClientTopBorderHeight() const {
586 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); 584 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight();
587 } 585 }
588 586
589 } // namespace ash 587 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/caption_buttons/frame_size_button_unittest.cc ('k') | ash/frame/custom_frame_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698