| 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.h" | 5 #include "ui/views/accessibility/native_view_accessibility.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/events/event_utils.h" | 8 #include "ui/events/event_utils.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/views/controls/native/native_view_host.h" | 10 #include "ui/views/controls/native/native_view_host.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 view_->GetTooltipText(gfx::Point(), &description); | 78 view_->GetTooltipText(gfx::Point(), &description); |
| 79 data_.AddStringAttribute(ui::AX_ATTR_DESCRIPTION, | 79 data_.AddStringAttribute(ui::AX_ATTR_DESCRIPTION, |
| 80 base::UTF16ToUTF8(description)); | 80 base::UTF16ToUTF8(description)); |
| 81 | 81 |
| 82 if (view_->IsAccessibilityFocusable()) | 82 if (view_->IsAccessibilityFocusable()) |
| 83 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); | 83 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); |
| 84 | 84 |
| 85 if (!view_->enabled()) | 85 if (!view_->enabled()) |
| 86 data_.state |= (1 << ui::AX_STATE_DISABLED); | 86 data_.state |= (1 << ui::AX_STATE_DISABLED); |
| 87 | 87 |
| 88 if (!view_->visible()) | 88 if (!view_->IsDrawn()) |
| 89 data_.state |= (1 << ui::AX_STATE_INVISIBLE); | 89 data_.state |= (1 << ui::AX_STATE_INVISIBLE); |
| 90 | 90 |
| 91 return data_; | 91 return data_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 int NativeViewAccessibility::GetChildCount() { | 94 int NativeViewAccessibility::GetChildCount() { |
| 95 int child_count = view_->child_count(); | 95 int child_count = view_->child_count(); |
| 96 | 96 |
| 97 std::vector<Widget*> child_widgets; | 97 std::vector<Widget*> child_widgets; |
| 98 PopulateChildWidgetVector(&child_widgets); | 98 PopulateChildWidgetVector(&child_widgets); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 child_widget_platform_node->GetDelegate()); | 276 child_widget_platform_node->GetDelegate()); |
| 277 if (child_widget_view_accessibility->parent_widget() != widget) | 277 if (child_widget_view_accessibility->parent_widget() != widget) |
| 278 child_widget_view_accessibility->SetParentWidget(widget); | 278 child_widget_view_accessibility->SetParentWidget(widget); |
| 279 } | 279 } |
| 280 | 280 |
| 281 result_child_widgets->push_back(child_widget); | 281 result_child_widgets->push_back(child_widget); |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace views | 285 } // namespace views |
| OLD | NEW |