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/panels/panel_frame_view.h" | 5 #include "ash/wm/panels/panel_frame_view.h" |
6 | 6 |
7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
8 #include "ash/frame/default_header_painter.h" | 8 #include "ash/frame/default_header_painter.h" |
9 #include "ash/frame/frame_border_hit_test_controller.h" | 9 #include "ash/frame/frame_border_hit_test_controller.h" |
10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 header_painter_->Init(frame_, this, window_icon_, caption_button_container_); | 53 header_painter_->Init(frame_, this, window_icon_, caption_button_container_); |
54 } | 54 } |
55 | 55 |
56 int PanelFrameView::NonClientTopBorderHeight() const { | 56 int PanelFrameView::NonClientTopBorderHeight() const { |
57 if (!header_painter_) | 57 if (!header_painter_) |
58 return 0; | 58 return 0; |
59 return header_painter_->GetHeaderHeightForPainting(); | 59 return header_painter_->GetHeaderHeightForPainting(); |
60 } | 60 } |
61 | 61 |
62 gfx::Size PanelFrameView::GetMinimumSize() { | 62 gfx::Size PanelFrameView::GetMinimumSize() const { |
63 if (!header_painter_) | 63 if (!header_painter_) |
64 return gfx::Size(); | 64 return gfx::Size(); |
65 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); | 65 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); |
66 return gfx::Size( | 66 return gfx::Size( |
67 std::max(header_painter_->GetMinimumHeaderWidth(), | 67 std::max(header_painter_->GetMinimumHeaderWidth(), |
68 min_client_view_size.width()), | 68 min_client_view_size.width()), |
69 NonClientTopBorderHeight() + min_client_view_size.height()); | 69 NonClientTopBorderHeight() + min_client_view_size.height()); |
70 } | 70 } |
71 | 71 |
72 void PanelFrameView::Layout() { | 72 void PanelFrameView::Layout() { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( | 125 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( |
126 const gfx::Rect& client_bounds) const { | 126 const gfx::Rect& client_bounds) const { |
127 gfx::Rect window_bounds = client_bounds; | 127 gfx::Rect window_bounds = client_bounds; |
128 window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0); | 128 window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0); |
129 return window_bounds; | 129 return window_bounds; |
130 } | 130 } |
131 | 131 |
132 } // namespace ash | 132 } // namespace ash |
OLD | NEW |