diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 800c86ebe7c8..96d90d14f66e 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -282,8 +282,8 @@ void App::OnFinishLaunching() { Emit("ready"); } -void App::OnAccessibilityChanged() { - Emit("accessibility-changed", IsAccessible()); +void App::OnAccessibilitySupportChanged() { + Emit("accessibility-support-changed", IsAccessibilitySupportEnabled()); } #if defined(OS_MACOSX) @@ -491,7 +491,7 @@ void App::DisableHardwareAcceleration(mate::Arguments* args) { content::GpuDataManager::GetInstance()->DisableHardwareAcceleration(); } -bool App::IsAccessible() { +bool App::IsAccessibilitySupportEnabled() { auto ax_state = content::BrowserAccessibilityState::GetInstance(); return ax_state->IsAccessibleBrowser(); } @@ -588,7 +588,8 @@ void App::BuildPrototype( .SetMethod("makeSingleInstance", &App::MakeSingleInstance) .SetMethod("releaseSingleInstance", &App::ReleaseSingleInstance) .SetMethod("relaunch", &App::Relaunch) - .SetMethod("isAccessible", &App::IsAccessible) + .SetMethod("IsAccessibilitySupportEnabled", + &App::IsAccessibilitySupportEnabled) .SetMethod("disableHardwareAcceleration", &App::DisableHardwareAcceleration); } diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index aa79b55f51b4..13cedaa7d898 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -72,7 +72,7 @@ class App : public AtomBrowserClient::Delegate, void OnFinishLaunching() override; void OnLogin(LoginHandler* login_handler, const base::DictionaryValue& request_details) override; - void OnAccessibilityChanged() override; + void OnAccessibilitySupportChanged() override; #if defined(OS_MACOSX) void OnContinueUserActivity( bool* prevent_default, @@ -114,7 +114,7 @@ class App : public AtomBrowserClient::Delegate, void ReleaseSingleInstance(); bool Relaunch(mate::Arguments* args); void DisableHardwareAcceleration(mate::Arguments* args); - bool IsAccessible(); + bool IsAccessibilitySupportEnabled(); #if defined(USE_NSS_CERTS) void ImportCertificate(const base::DictionaryValue& options, const net::CompletionCallback& callback); diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index 2727daae449e..dd958d0dc7d2 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -155,8 +155,10 @@ void Browser::DidFinishLaunching() { FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching()); } -void Browser::OnAccessibilityChanged() { - FOR_EACH_OBSERVER(BrowserObserver, observers_, OnAccessibilityChanged()); +void Browser::OnAccessibilitySupportChanged() { + FOR_EACH_OBSERVER(BrowserObserver, + observers_, + OnAccessibilitySupportChanged()); } void Browser::RequestLogin( diff --git a/atom/browser/browser.h b/atom/browser/browser.h index dbcb6b03bcec..7d493f054932 100644 --- a/atom/browser/browser.h +++ b/atom/browser/browser.h @@ -185,7 +185,7 @@ class Browser : public WindowListObserver { void WillFinishLaunching(); void DidFinishLaunching(); - void OnAccessibilityChanged(); + void OnAccessibilitySupportChanged(); // Request basic auth login. void RequestLogin(LoginHandler* login_handler, diff --git a/atom/browser/browser_observer.h b/atom/browser/browser_observer.h index 5ef4ee127926..4217939911c2 100644 --- a/atom/browser/browser_observer.h +++ b/atom/browser/browser_observer.h @@ -52,8 +52,8 @@ class BrowserObserver { virtual void OnLogin(LoginHandler* login_handler, const base::DictionaryValue& request_details) {} - // The browser's accessibility state has changed. - virtual void OnAccessibilityChanged() {}; + // The browser's accessibility suppport has changed. + virtual void OnAccessibilitySupportChanged() {}; #if defined(OS_MACOSX) // The browser wants to resume a user activity via handoff. (macOS only) diff --git a/atom/browser/mac/atom_application.mm b/atom/browser/mac/atom_application.mm index deb8d4dc4c9d..159852a59a83 100644 --- a/atom/browser/mac/atom_application.mm +++ b/atom/browser/mac/atom_application.mm @@ -84,7 +84,7 @@ ax_state->DisableAccessibility(); } - atom::Browser::Get()->OnAccessibilityChanged(); + atom::Browser::Get()->OnAccessibilitySupportChanged(); } @end diff --git a/atom/browser/native_window_views_win.cc b/atom/browser/native_window_views_win.cc index 9546dde69f53..9af003d55db0 100644 --- a/atom/browser/native_window_views_win.cc +++ b/atom/browser/native_window_views_win.cc @@ -99,7 +99,7 @@ bool NativeWindowViews::PreHandleMSG( if (axState && !axState->IsAccessibleBrowser()) { axState->OnScreenReaderDetected(); enabled_a11y_support_ = true; - Browser::Get()->OnAccessibilityChanged(); + Browser::Get()->OnAccessibilitySupportChanged(); } }