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

Unified Diff: content/browser/renderer_host/legacy_render_widget_host_win.cc

Issue 2581483002: Add support for faster, more limited accessibility modes. (Closed)
Patch Set: Disable tests that can't pass on Android with TODO Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/legacy_render_widget_host_win.cc
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 663ea76667b6be6ba0413745f3f4e3204a18beaf..8d3f11cba47bc494887ce2c022954c729fd6ed05 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -10,10 +10,10 @@
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "content/browser/accessibility/browser_accessibility_manager_win.h"
+#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "content/browser/accessibility/browser_accessibility_win.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
-#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/common/content_switches.h"
#include "ui/base/view_prop.h"
#include "ui/base/win/internal_constants.h"
@@ -119,7 +119,9 @@ bool LegacyRenderWidgetHostHWND::Init() {
reinterpret_cast<void **>(window_accessible_.Receive()));
DCHECK(SUCCEEDED(hr));
- if (!BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) {
+ AccessibilityMode mode =
+ BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode();
+ if (!(mode & ACCESSIBILITY_MODE_FLAG_NATIVE_APIS)) {
// Attempt to detect screen readers or other clients who want full
// accessibility support, by seeing if they respond to this event.
NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot,
@@ -161,8 +163,11 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message,
if (kIdScreenReaderHoneyPot == obj_id) {
// When an MSAA client has responded to our fake event on this id,
- // enable screen reader support.
- BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected();
+ // enable basic accessibility support. (Full screen reader support is
+ // detected later when specific more advanced APIs are accessed.)
+ BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags(
+ ACCESSIBILITY_MODE_FLAG_NATIVE_APIS |
+ ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS);
return static_cast<LRESULT>(0L);
}
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | content/renderer/accessibility/blink_ax_tree_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698