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 "ui/views/window/non_client_view.h" | 5 #include "ui/views/window/non_client_view.h" |
6 | 6 |
7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
8 #include "ui/base/hit_test.h" | 8 #include "ui/base/hit_test.h" |
9 #include "ui/views/widget/root_view.h" | 9 #include "ui/views/widget/root_view.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // GetMinimumSize() below. This will require implementing GetPreferredSize() | 122 // GetMinimumSize() below. This will require implementing GetPreferredSize() |
123 // better in the various frame views. | 123 // better in the various frame views. |
124 gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize()); | 124 gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize()); |
125 return GetWindowBoundsForClientBounds(client_bounds).size(); | 125 return GetWindowBoundsForClientBounds(client_bounds).size(); |
126 } | 126 } |
127 | 127 |
128 gfx::Size NonClientView::GetMinimumSize() { | 128 gfx::Size NonClientView::GetMinimumSize() { |
129 return frame_view_->GetMinimumSize(); | 129 return frame_view_->GetMinimumSize(); |
130 } | 130 } |
131 | 131 |
| 132 gfx::Size NonClientView::GetMaximumSize() { |
| 133 return frame_view_->GetMaximumSize(); |
| 134 } |
| 135 |
132 void NonClientView::Layout() { | 136 void NonClientView::Layout() { |
133 LayoutFrameView(); | 137 LayoutFrameView(); |
134 | 138 |
135 // Then layout the ClientView, using those bounds. | 139 // Then layout the ClientView, using those bounds. |
136 client_view_->SetBoundsRect(frame_view_->GetBoundsForClientView()); | 140 client_view_->SetBoundsRect(frame_view_->GetBoundsForClientView()); |
137 | 141 |
138 // We need to manually call Layout on the ClientView as well for the same | 142 // We need to manually call Layout on the ClientView as well for the same |
139 // reason as above. | 143 // reason as above. |
140 client_view_->Layout(); | 144 client_view_->Layout(); |
141 } | 145 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 std::string NonClientFrameView::GetClassName() const { | 272 std::string NonClientFrameView::GetClassName() const { |
269 return kViewClassName; | 273 return kViewClassName; |
270 } | 274 } |
271 | 275 |
272 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 276 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
273 // Overridden to do nothing. The NonClientView manually calls Layout on the | 277 // Overridden to do nothing. The NonClientView manually calls Layout on the |
274 // FrameView when it is itself laid out, see comment in NonClientView::Layout. | 278 // FrameView when it is itself laid out, see comment in NonClientView::Layout. |
275 } | 279 } |
276 | 280 |
277 } // namespace views | 281 } // namespace views |
OLD | NEW |