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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 gfx::NativeViewAccessible NativeViewAccessibilityBase::GetParent() { | 115 gfx::NativeViewAccessible NativeViewAccessibilityBase::GetParent() { |
116 if (view_->parent()) | 116 if (view_->parent()) |
117 return view_->parent()->GetNativeViewAccessible(); | 117 return view_->parent()->GetNativeViewAccessible(); |
118 | 118 |
119 if (parent_widget_) | 119 if (parent_widget_) |
120 return parent_widget_->GetRootView()->GetNativeViewAccessible(); | 120 return parent_widget_->GetRootView()->GetNativeViewAccessible(); |
121 | 121 |
122 return nullptr; | 122 return nullptr; |
123 } | 123 } |
124 | 124 |
125 gfx::Vector2d NativeViewAccessibilityBase::GetGlobalCoordinateOffset() { | 125 gfx::Rect NativeViewAccessibilityBase::GetScreenBoundsRect() const { |
126 return gfx::Vector2d(0, 0); // location is already in screen coordinates. | 126 // location is already in screen coordinates. |
dmazzoni
2017/04/04 15:05:19
This is supposed to return those coordinates, thou
| |
127 return gfx::Rect(0, 0, 0, 0); | |
127 } | 128 } |
128 | 129 |
129 gfx::NativeViewAccessible NativeViewAccessibilityBase::HitTestSync(int x, | 130 gfx::NativeViewAccessible NativeViewAccessibilityBase::HitTestSync(int x, |
130 int y) { | 131 int y) { |
131 if (!view_ || !view_->GetWidget()) | 132 if (!view_ || !view_->GetWidget()) |
132 return nullptr; | 133 return nullptr; |
133 | 134 |
134 // Search child widgets first, since they're on top in the z-order. | 135 // Search child widgets first, since they're on top in the z-order. |
135 std::vector<Widget*> child_widgets; | 136 std::vector<Widget*> child_widgets; |
136 PopulateChildWidgetVector(&child_widgets); | 137 PopulateChildWidgetVector(&child_widgets); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 child_widget_platform_node->GetDelegate()); | 257 child_widget_platform_node->GetDelegate()); |
257 if (child_widget_view_accessibility->parent_widget() != widget) | 258 if (child_widget_view_accessibility->parent_widget() != widget) |
258 child_widget_view_accessibility->SetParentWidget(widget); | 259 child_widget_view_accessibility->SetParentWidget(widget); |
259 } | 260 } |
260 | 261 |
261 result_child_widgets->push_back(child_widget); | 262 result_child_widgets->push_back(child_widget); |
262 } | 263 } |
263 } | 264 } |
264 | 265 |
265 } // namespace views | 266 } // namespace views |
OLD | NEW |