Even though this call is probably fast, it can potentially happen a lot, make it _really_ fast

This commit is contained in:
Paul Betts 2016-04-06 10:36:39 -07:00
parent c474ad0913
commit 6e7aa6d299
2 changed files with 10 additions and 1 deletions

View file

@ -199,6 +199,10 @@ class NativeWindowViews : public NativeWindow,
// In charge of running taskbar related APIs.
TaskbarHost taskbar_host_;
// If true we have enabled a11y
bool enabled_a11y_support_;
#endif
// Handles unhandled keyboard messages coming back from the renderer process.

View file

@ -91,11 +91,16 @@ bool NativeWindowViews::PreHandleMSG(
// accessibility object.
case WM_GETOBJECT: {
const DWORD obj_id = static_cast<DWORD>(l_param);
if (enabled_a11y_support_) return false;
if (obj_id == OBJID_CLIENT) {
const auto axState = content::BrowserAccessibilityState::GetInstance();
if (axState && !axState->IsAccessibleBrowser())
if (axState && !axState->IsAccessibleBrowser()) {
axState->OnScreenReaderDetected();
enabled_a11y_support_ = true;
}
}
return false;
}
case WM_COMMAND: