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

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

Issue 2795543002: Add GetScreenBoundsRect to ui::AXPlatformNodeDelegate (Closed)
Patch Set: Add GetScreenBoundsRect() to ui::AXPlatformNodeDelegate 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 AXActionData data; 256 AXActionData data;
257 data.action = ui::AX_ACTION_DO_DEFAULT; 257 data.action = ui::AX_ACTION_DO_DEFAULT;
258 if (delegate_->AccessibilityPerformAction(data)) 258 if (delegate_->AccessibilityPerformAction(data))
259 return S_OK; 259 return S_OK;
260 return E_FAIL; 260 return E_FAIL;
261 } 261 }
262 262
263 STDMETHODIMP AXPlatformNodeWin::accLocation( 263 STDMETHODIMP AXPlatformNodeWin::accLocation(
264 LONG* x_left, LONG* y_top, LONG* width, LONG* height, VARIANT var_id) { 264 LONG* x_left, LONG* y_top, LONG* width, LONG* height, VARIANT var_id) {
265 COM_OBJECT_VALIDATE_VAR_ID_4_ARGS(var_id, x_left, y_top, width, height); 265 COM_OBJECT_VALIDATE_VAR_ID_4_ARGS(var_id, x_left, y_top, width, height);
266 gfx::Rect bounds = gfx::ToEnclosingRect(GetData().location); 266 gfx::Rect bounds = delegate_->GetScreenBoundsRect();
267 bounds += delegate_->GetGlobalCoordinateOffset();
268 *x_left = bounds.x(); 267 *x_left = bounds.x();
269 *y_top = bounds.y(); 268 *y_top = bounds.y();
270 *width = bounds.width(); 269 *width = bounds.width();
271 *height = bounds.height(); 270 *height = bounds.height();
272 271
273 if (bounds.IsEmpty()) 272 if (bounds.IsEmpty())
274 return S_FALSE; 273 return S_FALSE;
275 274
276 return S_OK; 275 return S_OK;
277 } 276 }
278 277
279 STDMETHODIMP AXPlatformNodeWin::accNavigate( 278 STDMETHODIMP AXPlatformNodeWin::accNavigate(
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 ui::TextBoundaryDirection direction) { 1194 ui::TextBoundaryDirection direction) {
1196 HandleSpecialTextOffset(&start_offset); 1195 HandleSpecialTextOffset(&start_offset);
1197 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1196 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1198 std::vector<int32_t> line_breaks; 1197 std::vector<int32_t> line_breaks;
1199 return static_cast<LONG>(ui::FindAccessibleTextBoundary( 1198 return static_cast<LONG>(ui::FindAccessibleTextBoundary(
1200 text, line_breaks, boundary, start_offset, direction, 1199 text, line_breaks, boundary, start_offset, direction,
1201 AX_TEXT_AFFINITY_DOWNSTREAM)); 1200 AX_TEXT_AFFINITY_DOWNSTREAM));
1202 } 1201 }
1203 1202
1204 } // namespace ui 1203 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698