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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 gfx::NativeViewAccessible NativeViewAccessibilityBase::GetParent() { | 104 gfx::NativeViewAccessible NativeViewAccessibilityBase::GetParent() { |
105 if (view_->parent()) | 105 if (view_->parent()) |
106 return view_->parent()->GetNativeViewAccessible(); | 106 return view_->parent()->GetNativeViewAccessible(); |
107 | 107 |
108 if (parent_widget_) | 108 if (parent_widget_) |
109 return parent_widget_->GetRootView()->GetNativeViewAccessible(); | 109 return parent_widget_->GetRootView()->GetNativeViewAccessible(); |
110 | 110 |
111 return nullptr; | 111 return nullptr; |
112 } | 112 } |
113 | 113 |
114 gfx::Vector2d NativeViewAccessibilityBase::GetGlobalCoordinateOffset() { | 114 gfx::Rect NativeViewAccessibilityBase::GetScreenBoundsRect() const { |
115 return gfx::Vector2d(0, 0); // location is already in screen coordinates. | 115 return view_->GetBoundsInScreen(); |
116 } | 116 } |
117 | 117 |
118 gfx::NativeViewAccessible NativeViewAccessibilityBase::HitTestSync(int x, | 118 gfx::NativeViewAccessible NativeViewAccessibilityBase::HitTestSync(int x, |
119 int y) { | 119 int y) { |
120 if (!view_ || !view_->GetWidget()) | 120 if (!view_ || !view_->GetWidget()) |
121 return nullptr; | 121 return nullptr; |
122 | 122 |
123 // Search child widgets first, since they're on top in the z-order. | 123 // Search child widgets first, since they're on top in the z-order. |
124 std::vector<Widget*> child_widgets; | 124 std::vector<Widget*> child_widgets; |
125 PopulateChildWidgetVector(&child_widgets); | 125 PopulateChildWidgetVector(&child_widgets); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 child_widget_platform_node->GetDelegate()); | 220 child_widget_platform_node->GetDelegate()); |
221 if (child_widget_view_accessibility->parent_widget() != widget) | 221 if (child_widget_view_accessibility->parent_widget() != widget) |
222 child_widget_view_accessibility->SetParentWidget(widget); | 222 child_widget_view_accessibility->SetParentWidget(widget); |
223 } | 223 } |
224 | 224 |
225 result_child_widgets->push_back(child_widget); | 225 result_child_widgets->push_back(child_widget); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 } // namespace views | 229 } // namespace views |
OLD | NEW |