| 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/client_view.h" | 5 #include "ui/views/window/client_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 bool ClientView::CanClose() { | 38 bool ClientView::CanClose() { |
| 39 return true; | 39 return true; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void ClientView::WidgetClosing() { | 42 void ClientView::WidgetClosing() { |
| 43 } | 43 } |
| 44 | 44 |
| 45 /////////////////////////////////////////////////////////////////////////////// | 45 /////////////////////////////////////////////////////////////////////////////// |
| 46 // ClientView, View overrides: | 46 // ClientView, View overrides: |
| 47 | 47 |
| 48 gfx::Size ClientView::GetPreferredSize() { | 48 gfx::Size ClientView::GetPreferredSize() const { |
| 49 // |contents_view_| is allowed to be NULL up until the point where this view | 49 // |contents_view_| is allowed to be NULL up until the point where this view |
| 50 // is attached to a Container. | 50 // is attached to a Container. |
| 51 return contents_view_ ? contents_view_->GetPreferredSize() : gfx::Size(); | 51 return contents_view_ ? contents_view_->GetPreferredSize() : gfx::Size(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 gfx::Size ClientView::GetMaximumSize() { | 54 gfx::Size ClientView::GetMaximumSize() { |
| 55 // |contents_view_| is allowed to be NULL up until the point where this view | 55 // |contents_view_| is allowed to be NULL up until the point where this view |
| 56 // is attached to a Container. | 56 // is attached to a Container. |
| 57 return contents_view_ ? contents_view_->GetMaximumSize() : gfx::Size(); | 57 return contents_view_ ? contents_view_->GetMaximumSize() : gfx::Size(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 gfx::Size ClientView::GetMinimumSize() { | 60 gfx::Size ClientView::GetMinimumSize() const { |
| 61 // |contents_view_| is allowed to be NULL up until the point where this view | 61 // |contents_view_| is allowed to be NULL up until the point where this view |
| 62 // is attached to a Container. | 62 // is attached to a Container. |
| 63 return contents_view_ ? contents_view_->GetMinimumSize() : gfx::Size(); | 63 return contents_view_ ? contents_view_->GetMinimumSize() : gfx::Size(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ClientView::Layout() { | 66 void ClientView::Layout() { |
| 67 // |contents_view_| is allowed to be NULL up until the point where this view | 67 // |contents_view_| is allowed to be NULL up until the point where this view |
| 68 // is attached to a Container. | 68 // is attached to a Container. |
| 69 if (contents_view_) | 69 if (contents_view_) |
| 70 contents_view_->SetBounds(0, 0, width(), height()); | 70 contents_view_->SetBounds(0, 0, width(), height()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 if (details.is_add && details.child == this) { | 89 if (details.is_add && details.child == this) { |
| 90 DCHECK(GetWidget()); | 90 DCHECK(GetWidget()); |
| 91 DCHECK(contents_view_); // |contents_view_| must be valid now! | 91 DCHECK(contents_view_); // |contents_view_| must be valid now! |
| 92 // Insert |contents_view_| at index 0 so it is first in the focus chain. | 92 // Insert |contents_view_| at index 0 so it is first in the focus chain. |
| 93 // (the OK/Cancel buttons are inserted before contents_view_) | 93 // (the OK/Cancel buttons are inserted before contents_view_) |
| 94 AddChildViewAt(contents_view_, 0); | 94 AddChildViewAt(contents_view_, 0); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace views | 98 } // namespace views |
| OLD | NEW |