| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 gfx::NativeWindow NativeViewAccessibility::GetTopLevelWidget() { | 120 gfx::NativeWindow NativeViewAccessibility::GetTopLevelWidget() { |
| 121 if (view_->GetWidget()) | 121 if (view_->GetWidget()) |
| 122 return view_->GetWidget()->GetTopLevelWidget()->GetNativeWindow(); | 122 return view_->GetWidget()->GetTopLevelWidget()->GetNativeWindow(); |
| 123 return nullptr; | 123 return nullptr; |
| 124 } | 124 } |
| 125 | 125 |
| 126 gfx::NativeViewAccessible NativeViewAccessibility::GetParent() { | 126 gfx::NativeViewAccessible NativeViewAccessibility::GetParent() { |
| 127 if (view_->parent()) | 127 if (view_->parent()) |
| 128 return view_->parent()->GetNativeViewAccessible(); | 128 return view_->parent()->GetNativeViewAccessible(); |
| 129 | 129 |
| 130 // TODO: move this to NativeViewAccessibilityMac. | |
| 131 #if defined(OS_MACOSX) | |
| 132 if (view_->GetWidget()) | |
| 133 return view_->GetWidget()->GetNativeView(); | |
| 134 #endif | |
| 135 | |
| 136 if (parent_widget_) | 130 if (parent_widget_) |
| 137 return parent_widget_->GetRootView()->GetNativeViewAccessible(); | 131 return parent_widget_->GetRootView()->GetNativeViewAccessible(); |
| 138 | 132 |
| 139 return nullptr; | 133 return nullptr; |
| 140 } | 134 } |
| 141 | 135 |
| 142 gfx::Vector2d NativeViewAccessibility::GetGlobalCoordinateOffset() { | 136 gfx::Vector2d NativeViewAccessibility::GetGlobalCoordinateOffset() { |
| 143 return gfx::Vector2d(0, 0); // location is already in screen coordinates. | 137 return gfx::Vector2d(0, 0); // location is already in screen coordinates. |
| 144 } | 138 } |
| 145 | 139 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 child_widget_platform_node->GetDelegate()); | 270 child_widget_platform_node->GetDelegate()); |
| 277 if (child_widget_view_accessibility->parent_widget() != widget) | 271 if (child_widget_view_accessibility->parent_widget() != widget) |
| 278 child_widget_view_accessibility->SetParentWidget(widget); | 272 child_widget_view_accessibility->SetParentWidget(widget); |
| 279 } | 273 } |
| 280 | 274 |
| 281 result_child_widgets->push_back(child_widget); | 275 result_child_widgets->push_back(child_widget); |
| 282 } | 276 } |
| 283 } | 277 } |
| 284 | 278 |
| 285 } // namespace views | 279 } // namespace views |
| OLD | NEW |