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

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 1809573003: Fix support for accessible action verbs and performing the default action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix two tests Created 4 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_win.h" 5 #include "content/browser/accessibility/browser_accessibility_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // 224 //
225 225
226 HRESULT BrowserAccessibilityWin::accDoDefaultAction(VARIANT var_id) { 226 HRESULT BrowserAccessibilityWin::accDoDefaultAction(VARIANT var_id) {
227 if (!instance_active()) 227 if (!instance_active())
228 return E_FAIL; 228 return E_FAIL;
229 229
230 BrowserAccessibilityWin* target = GetTargetFromChildID(var_id); 230 BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
231 if (!target) 231 if (!target)
232 return E_INVALIDARG; 232 return E_INVALIDARG;
233 233
234 // Return an error if it's not clickable.
235 if (!target->HasStringAttribute(ui::AX_ATTR_ACTION))
236 return DISP_E_MEMBERNOTFOUND;
237
234 manager()->DoDefaultAction(*target); 238 manager()->DoDefaultAction(*target);
235 return S_OK; 239 return S_OK;
236 } 240 }
237 241
238 STDMETHODIMP BrowserAccessibilityWin::accHitTest(LONG x_left, 242 STDMETHODIMP BrowserAccessibilityWin::accHitTest(LONG x_left,
239 LONG y_top, 243 LONG y_top,
240 VARIANT* child) { 244 VARIANT* child) {
241 if (!instance_active()) 245 if (!instance_active())
242 return E_FAIL; 246 return E_FAIL;
243 247
(...skipping 4441 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 return static_cast<BrowserAccessibilityWin*>(obj); 4689 return static_cast<BrowserAccessibilityWin*>(obj);
4686 } 4690 }
4687 4691
4688 const BrowserAccessibilityWin* 4692 const BrowserAccessibilityWin*
4689 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { 4693 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) {
4690 DCHECK(!obj || obj->IsNative()); 4694 DCHECK(!obj || obj->IsNative());
4691 return static_cast<const BrowserAccessibilityWin*>(obj); 4695 return static_cast<const BrowserAccessibilityWin*>(obj);
4692 } 4696 }
4693 4697
4694 } // namespace content 4698 } // namespace content
OLDNEW
« no previous file with comments | « content/app/strings/content_strings.grd ('k') | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698