| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/accessibility/native_view_accessibility_base.h" | 5 #include "ui/views/accessibility/native_view_accessibility_base.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 if (focused) | 43 if (focused) |
| 44 view_->RequestFocus(); | 44 view_->RequestFocus(); |
| 45 else if (view_->HasFocus()) | 45 else if (view_->HasFocus()) |
| 46 view_->GetFocusManager()->ClearFocus(); | 46 view_->GetFocusManager()->ClearFocus(); |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // ui::AXPlatformNodeDelegate | 50 // ui::AXPlatformNodeDelegate |
| 51 | 51 |
| 52 const ui::AXNodeData& NativeViewAccessibilityBase::GetData() { | 52 const ui::AXNodeData& NativeViewAccessibilityBase::GetData() const { |
| 53 data_ = ui::AXNodeData(); | 53 data_ = ui::AXNodeData(); |
| 54 data_.state = 0; | 54 data_.state = 0; |
| 55 | 55 |
| 56 // Views may misbehave if their widget is closed; return an unknown role | 56 // Views may misbehave if their widget is closed; return an unknown role |
| 57 // rather than possibly crashing. | 57 // rather than possibly crashing. |
| 58 if (!view_->GetWidget() || view_->GetWidget()->IsClosed()) { | 58 if (!view_->GetWidget() || view_->GetWidget()->IsClosed()) { |
| 59 data_.role = ui::AX_ROLE_UNKNOWN; | 59 data_.role = ui::AX_ROLE_UNKNOWN; |
| 60 data_.state = 1 << ui::AX_STATE_DISABLED; | 60 data_.state = 1 << ui::AX_STATE_DISABLED; |
| 61 return data_; | 61 return data_; |
| 62 } | 62 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 child_widget_platform_node->GetDelegate()); | 256 child_widget_platform_node->GetDelegate()); |
| 257 if (child_widget_view_accessibility->parent_widget() != widget) | 257 if (child_widget_view_accessibility->parent_widget() != widget) |
| 258 child_widget_view_accessibility->SetParentWidget(widget); | 258 child_widget_view_accessibility->SetParentWidget(widget); |
| 259 } | 259 } |
| 260 | 260 |
| 261 result_child_widgets->push_back(child_widget); | 261 result_child_widgets->push_back(child_widget); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace views | 265 } // namespace views |
| OLD | NEW |