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

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

Issue 2849063002: Forward BrowserAccessibilityWin::get_accKeyboardShortcut to the platform node (Closed)
Patch Set: Add has check to ensure we don't override key shortcut Created 3 years, 6 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) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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_com_win.h" 5 #include "content/browser/accessibility/browser_accessibility_com_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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 return AXPlatformNodeWin::get_accHelp(var_id, help); 588 return AXPlatformNodeWin::get_accHelp(var_id, help);
589 } 589 }
590 590
591 STDMETHODIMP BrowserAccessibilityComWin::get_accKeyboardShortcut( 591 STDMETHODIMP BrowserAccessibilityComWin::get_accKeyboardShortcut(
592 VARIANT var_id, 592 VARIANT var_id,
593 BSTR* acc_key) { 593 BSTR* acc_key) {
594 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_KEYBOARD_SHORTCUT); 594 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_KEYBOARD_SHORTCUT);
595 if (!owner()) 595 if (!owner())
596 return E_FAIL; 596 return E_FAIL;
597 597
598 if (!acc_key) 598 return AXPlatformNodeWin::get_accKeyboardShortcut(var_id, acc_key);
599 return E_INVALIDARG;
600
601 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id);
602 if (!target)
603 return E_INVALIDARG;
604
605 if (target->HasStringAttribute(ui::AX_ATTR_KEY_SHORTCUTS)) {
606 return target->GetStringAttributeAsBstr(ui::AX_ATTR_KEY_SHORTCUTS, acc_key);
607 }
608
609 return target->GetStringAttributeAsBstr(ui::AX_ATTR_SHORTCUT, acc_key);
610 } 599 }
611 600
612 STDMETHODIMP BrowserAccessibilityComWin::get_accName(VARIANT var_id, 601 STDMETHODIMP BrowserAccessibilityComWin::get_accName(VARIANT var_id,
613 BSTR* name) { 602 BSTR* name) {
614 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_NAME); 603 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_NAME);
615 if (!owner()) 604 if (!owner())
616 return E_FAIL; 605 return E_FAIL;
617 606
618 return AXPlatformNodeWin::get_accName(var_id, name); 607 return AXPlatformNodeWin::get_accName(var_id, name);
619 } 608 }
(...skipping 4971 matching lines...) Expand 10 before | Expand all | Expand 10 after
5591 5580
5592 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( 5581 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin(
5593 BrowserAccessibility* obj) { 5582 BrowserAccessibility* obj) {
5594 if (!obj || !obj->IsNative()) 5583 if (!obj || !obj->IsNative())
5595 return nullptr; 5584 return nullptr;
5596 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); 5585 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM();
5597 return result; 5586 return result;
5598 } 5587 }
5599 5588
5600 } // namespace content 5589 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.cc ('k') | content/renderer/accessibility/blink_ax_tree_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698