| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "ui/base/accessibility/accessible_view_state.h" | 6 #include "ui/base/accessibility/accessible_view_state.h" |
| 7 #include "views/window/client_view.h" | 7 #include "views/window/client_view.h" |
| 8 #if defined(OS_LINUX) | 8 #if defined(OS_LINUX) |
| 9 #include "views/window/hit_test.h" | 9 #include "views/window/hit_test.h" |
| 10 #endif | 10 #endif |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 std::string ClientView::GetClassName() const { | 73 std::string ClientView::GetClassName() const { |
| 74 return kViewClassName; | 74 return kViewClassName; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { | 77 void ClientView::GetAccessibleState(ui::AccessibleViewState* state) { |
| 78 if (is_add && child == this) { | 78 state->role = ui::AccessibilityTypes::ROLE_CLIENT; |
| 79 DCHECK(GetWidget()); | |
| 80 DCHECK(contents_view_); // |contents_view_| must be valid now! | |
| 81 // Insert |contents_view_| at index 0 so it is first in the focus chain. | |
| 82 // (the OK/Cancel buttons are inserted before contents_view_) | |
| 83 AddChildViewAt(contents_view_, 0); | |
| 84 } | |
| 85 } | 79 } |
| 86 | 80 |
| 87 void ClientView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 81 void ClientView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 88 // Overridden to do nothing. The NonClientView manually calls Layout on the | 82 // Overridden to do nothing. The NonClientView manually calls Layout on the |
| 89 // ClientView when it is itself laid out, see comment in | 83 // ClientView when it is itself laid out, see comment in |
| 90 // NonClientView::Layout. | 84 // NonClientView::Layout. |
| 91 } | 85 } |
| 92 | 86 |
| 93 void ClientView::GetAccessibleState(ui::AccessibleViewState* state) { | 87 void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { |
| 94 state->role = ui::AccessibilityTypes::ROLE_CLIENT; | 88 if (is_add && child == this) { |
| 89 DCHECK(GetWidget()); |
| 90 DCHECK(contents_view_); // |contents_view_| must be valid now! |
| 91 // Insert |contents_view_| at index 0 so it is first in the focus chain. |
| 92 // (the OK/Cancel buttons are inserted before contents_view_) |
| 93 AddChildViewAt(contents_view_, 0); |
| 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace views | 97 } // namespace views |
| OLD | NEW |