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

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

Issue 2627733003: Don't enable accessibility just because IAccessible2 APIs are queried. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after
3616 // IServiceProvider methods. 3616 // IServiceProvider methods.
3617 // 3617 //
3618 3618
3619 STDMETHODIMP BrowserAccessibilityWin::QueryService(REFGUID guid_service, 3619 STDMETHODIMP BrowserAccessibilityWin::QueryService(REFGUID guid_service,
3620 REFIID riid, 3620 REFIID riid,
3621 void** object) { 3621 void** object) {
3622 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_QUERY_SERVICE); 3622 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_QUERY_SERVICE);
3623 if (!instance_active()) 3623 if (!instance_active())
3624 return E_FAIL; 3624 return E_FAIL;
3625 3625
3626 // The system uses IAccessible APIs for many purposes, but only
3627 // assistive technology like screen readers uses IAccessible2.
3628 // Enable full accessibility support when IAccessible2 APIs are queried.
3629 if (riid == IID_IAccessible2)
3630 BrowserAccessibilityStateImpl::GetInstance()->EnableAccessibility();
3631
3632 if (guid_service == GUID_IAccessibleContentDocument) { 3626 if (guid_service == GUID_IAccessibleContentDocument) {
3633 // Special Mozilla extension: return the accessible for the root document. 3627 // Special Mozilla extension: return the accessible for the root document.
3634 // Screen readers use this to distinguish between a document loaded event 3628 // Screen readers use this to distinguish between a document loaded event
3635 // on the root document vs on an iframe. 3629 // on the root document vs on an iframe.
3636 BrowserAccessibility* node = this; 3630 BrowserAccessibility* node = this;
3637 while (node->GetParent()) 3631 while (node->GetParent())
3638 node = node->GetParent()->manager()->GetRoot(); 3632 node = node->GetParent()->manager()->GetRoot();
3639 return ToBrowserAccessibilityWin(node)->QueryInterface( 3633 return ToBrowserAccessibilityWin(node)->QueryInterface(
3640 IID_IAccessible2, object); 3634 IID_IAccessible2, object);
3641 } 3635 }
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
5713 return static_cast<BrowserAccessibilityWin*>(obj); 5707 return static_cast<BrowserAccessibilityWin*>(obj);
5714 } 5708 }
5715 5709
5716 const BrowserAccessibilityWin* 5710 const BrowserAccessibilityWin*
5717 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { 5711 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) {
5718 DCHECK(!obj || obj->IsNative()); 5712 DCHECK(!obj || obj->IsNative());
5719 return static_cast<const BrowserAccessibilityWin*>(obj); 5713 return static_cast<const BrowserAccessibilityWin*>(obj);
5720 } 5714 }
5721 5715
5722 } // namespace content 5716 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698