Even though this call is probably fast, it can potentially happen a lot, make it _really_ fast
This commit is contained in:
parent
c474ad0913
commit
6e7aa6d299
2 changed files with 10 additions and 1 deletions
|
@ -199,6 +199,10 @@ class NativeWindowViews : public NativeWindow,
|
||||||
|
|
||||||
// In charge of running taskbar related APIs.
|
// In charge of running taskbar related APIs.
|
||||||
TaskbarHost taskbar_host_;
|
TaskbarHost taskbar_host_;
|
||||||
|
|
||||||
|
// If true we have enabled a11y
|
||||||
|
bool enabled_a11y_support_;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||||
|
|
|
@ -91,11 +91,16 @@ bool NativeWindowViews::PreHandleMSG(
|
||||||
// accessibility object.
|
// accessibility object.
|
||||||
case WM_GETOBJECT: {
|
case WM_GETOBJECT: {
|
||||||
const DWORD obj_id = static_cast<DWORD>(l_param);
|
const DWORD obj_id = static_cast<DWORD>(l_param);
|
||||||
|
if (enabled_a11y_support_) return false;
|
||||||
|
|
||||||
if (obj_id == OBJID_CLIENT) {
|
if (obj_id == OBJID_CLIENT) {
|
||||||
const auto axState = content::BrowserAccessibilityState::GetInstance();
|
const auto axState = content::BrowserAccessibilityState::GetInstance();
|
||||||
if (axState && !axState->IsAccessibleBrowser())
|
if (axState && !axState->IsAccessibleBrowser()) {
|
||||||
axState->OnScreenReaderDetected();
|
axState->OnScreenReaderDetected();
|
||||||
|
enabled_a11y_support_ = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue