Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: ui/accessibility/platform/ax_platform_node_base.cc

Issue 2795543002: Add GetScreenBoundsRect to ui::AXPlatformNodeDelegate (Closed)
Patch Set: Remove GetGlobalCoordinateOffset Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/accessibility/platform/ax_platform_node_base.h" 5 #include "ui/accessibility/platform/ax_platform_node_base.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_action_data.h" 8 #include "ui/accessibility/ax_action_data.h"
9 #include "ui/accessibility/ax_node_data.h" 9 #include "ui/accessibility/ax_node_data.h"
10 #include "ui/accessibility/platform/ax_platform_node_delegate.h" 10 #include "ui/accessibility/platform/ax_platform_node_delegate.h"
11 #include "ui/gfx/geometry/rect_conversions.h" 11 #include "ui/gfx/geometry/rect_conversions.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) { 15 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) {
16 delegate_ = delegate; 16 delegate_ = delegate;
17 } 17 }
18 18
19 const AXNodeData& AXPlatformNodeBase::GetData() const { 19 const AXNodeData& AXPlatformNodeBase::GetData() const {
20 CHECK(delegate_); 20 CHECK(delegate_);
21 return delegate_->GetData(); 21 return delegate_->GetData();
22 } 22 }
23 23
24 gfx::Rect AXPlatformNodeBase::GetBoundsInScreen() const { 24 gfx::Rect AXPlatformNodeBase::GetBoundsInScreen() const {
25 CHECK(delegate_); 25 CHECK(delegate_);
26 gfx::Rect bounds = gfx::ToEnclosingRect(GetData().location); 26 gfx::Rect bounds = gfx::ToEnclosingRect(GetData().location);
27 bounds.Offset(delegate_->GetGlobalCoordinateOffset()); 27 gfx::Rect screen_bounds = delegate_->GetScreenBoundsRect();
28 bounds.Offset(screen_bounds.x(), screen_bounds.y());
dmazzoni 2017/04/04 15:05:19 I don't think this should be here. It should just
28 return bounds; 29 return bounds;
29 } 30 }
30 31
31 gfx::NativeViewAccessible AXPlatformNodeBase::GetParent() { 32 gfx::NativeViewAccessible AXPlatformNodeBase::GetParent() {
32 CHECK(delegate_); 33 CHECK(delegate_);
33 return delegate_->GetParent(); 34 return delegate_->GetParent();
34 } 35 }
35 36
36 int AXPlatformNodeBase::GetChildCount() { 37 int AXPlatformNodeBase::GetChildCount() {
37 CHECK(delegate_); 38 CHECK(delegate_);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 ui::AXActionData action_data; 210 ui::AXActionData action_data;
210 action_data.action = ui::AX_ACTION_SET_SELECTION; 211 action_data.action = ui::AX_ACTION_SET_SELECTION;
211 action_data.anchor_node_id = action_data.focus_node_id = GetData().id; 212 action_data.anchor_node_id = action_data.focus_node_id = GetData().id;
212 action_data.anchor_offset = start_offset; 213 action_data.anchor_offset = start_offset;
213 action_data.focus_offset = end_offset; 214 action_data.focus_offset = end_offset;
214 DCHECK(delegate_); 215 DCHECK(delegate_);
215 return delegate_->AccessibilityPerformAction(action_data); 216 return delegate_->AccessibilityPerformAction(action_data);
216 } 217 }
217 218
218 } // namespace ui 219 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698