OLD | NEW |
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/wm/custom_frame_view_ash.h" | 5 #include "ash/wm/custom_frame_view_ash.h" |
6 | 6 |
7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
8 #include "ash/wm/frame_painter.h" | 8 #include "ash/wm/frame_painter.h" |
9 #include "grit/ash_resources.h" | 9 #include "grit/ash_resources.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 void CustomFrameViewAsh::Init(views::Widget* frame) { | 47 void CustomFrameViewAsh::Init(views::Widget* frame) { |
48 frame_ = frame; | 48 frame_ = frame; |
49 | 49 |
50 // Unfortunately, there is no views::WidgetDelegate::CanMinimize(). Assume | 50 // Unfortunately, there is no views::WidgetDelegate::CanMinimize(). Assume |
51 // that the window frame can be minimized if it can be maximized. | 51 // that the window frame can be minimized if it can be maximized. |
52 FrameCaptionButtonContainerView::MinimizeAllowed minimize_allowed = | 52 FrameCaptionButtonContainerView::MinimizeAllowed minimize_allowed = |
53 frame_->widget_delegate()->CanMaximize() ? | 53 frame_->widget_delegate()->CanMaximize() ? |
54 FrameCaptionButtonContainerView::MINIMIZE_ALLOWED : | 54 FrameCaptionButtonContainerView::MINIMIZE_ALLOWED : |
55 FrameCaptionButtonContainerView::MINIMIZE_DISALLOWED; | 55 FrameCaptionButtonContainerView::MINIMIZE_DISALLOWED; |
56 caption_button_container_ = new FrameCaptionButtonContainerView(this, frame, | 56 caption_button_container_ = new FrameCaptionButtonContainerView(frame, |
57 minimize_allowed); | 57 minimize_allowed); |
58 AddChildView(caption_button_container_); | 58 AddChildView(caption_button_container_); |
59 | 59 |
60 frame_painter_->Init(frame_, NULL, caption_button_container_); | 60 frame_painter_->Init(frame_, NULL, caption_button_container_); |
61 } | 61 } |
62 | 62 |
63 //////////////////////////////////////////////////////////////////////////////// | 63 //////////////////////////////////////////////////////////////////////////////// |
64 // CustomFrameViewAsh, views::NonClientFrameView overrides: | 64 // CustomFrameViewAsh, views::NonClientFrameView overrides: |
65 gfx::Rect CustomFrameViewAsh::GetBoundsForClientView() const { | 65 gfx::Rect CustomFrameViewAsh::GetBoundsForClientView() const { |
66 int top_height = NonClientTopBorderHeight(); | 66 int top_height = NonClientTopBorderHeight(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (frame_->IsFullscreen()) | 158 if (frame_->IsFullscreen()) |
159 return 0; | 159 return 0; |
160 | 160 |
161 // Reserve enough space to see the buttons, including any offset from top and | 161 // Reserve enough space to see the buttons, including any offset from top and |
162 // reserving space for the separator line. | 162 // reserving space for the separator line. |
163 return caption_button_container_->bounds().bottom() + | 163 return caption_button_container_->bounds().bottom() + |
164 frame_painter_->HeaderContentSeparatorSize(); | 164 frame_painter_->HeaderContentSeparatorSize(); |
165 } | 165 } |
166 | 166 |
167 } // namespace ash | 167 } // namespace ash |
OLD | NEW |