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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlcom.h> 6 #include <atlcom.h>
7 #include <limits.h> 7 #include <limits.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 HRESULT AXPlatformNodeWin::accDoDefaultAction(VARIANT var_id) { 254 HRESULT AXPlatformNodeWin::accDoDefaultAction(VARIANT var_id) {
255 COM_OBJECT_VALIDATE_VAR_ID(var_id); 255 COM_OBJECT_VALIDATE_VAR_ID(var_id);
256 delegate_->DoDefaultAction(); 256 delegate_->DoDefaultAction();
257 return S_OK; 257 return S_OK;
258 } 258 }
259 259
260 STDMETHODIMP AXPlatformNodeWin::accLocation( 260 STDMETHODIMP AXPlatformNodeWin::accLocation(
261 LONG* x_left, LONG* y_top, LONG* width, LONG* height, VARIANT var_id) { 261 LONG* x_left, LONG* y_top, LONG* width, LONG* height, VARIANT var_id) {
262 COM_OBJECT_VALIDATE_VAR_ID_4_ARGS(var_id, x_left, y_top, width, height); 262 COM_OBJECT_VALIDATE_VAR_ID_4_ARGS(var_id, x_left, y_top, width, height);
263 gfx::Rect bounds = gfx::ToEnclosingRect(GetData().location); 263 gfx::Rect bounds = gfx::ToEnclosingRect(GetData().location);
264 bounds += delegate_->GetGlobalCoordinateOffset(); 264 gfx::Rect screen_bounds = delegate_->GetScreenBoundsRect();
dmazzoni 2017/04/04 15:05:19 Same here - it should just call GetScreenBoundsRec
265 *x_left = bounds.x(); 265
266 *y_top = bounds.y(); 266 *x_left = bounds.x() + screen_bounds.x();
267 *y_top = bounds.y() + screen_bounds.y();
267 *width = bounds.width(); 268 *width = bounds.width();
268 *height = bounds.height(); 269 *height = bounds.height();
269 270
270 if (bounds.IsEmpty()) 271 if (bounds.IsEmpty())
271 return S_FALSE; 272 return S_FALSE;
272 273
273 return S_OK; 274 return S_OK;
274 } 275 }
275 276
276 STDMETHODIMP AXPlatformNodeWin::accNavigate( 277 STDMETHODIMP AXPlatformNodeWin::accNavigate(
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 ui::TextBoundaryDirection direction) { 1193 ui::TextBoundaryDirection direction) {
1193 HandleSpecialTextOffset(&start_offset); 1194 HandleSpecialTextOffset(&start_offset);
1194 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1195 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1195 std::vector<int32_t> line_breaks; 1196 std::vector<int32_t> line_breaks;
1196 return static_cast<LONG>(ui::FindAccessibleTextBoundary( 1197 return static_cast<LONG>(ui::FindAccessibleTextBoundary(
1197 text, line_breaks, boundary, start_offset, direction, 1198 text, line_breaks, boundary, start_offset, direction,
1198 AX_TEXT_AFFINITY_DOWNSTREAM)); 1199 AX_TEXT_AFFINITY_DOWNSTREAM));
1199 } 1200 }
1200 1201
1201 } // namespace ui 1202 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698