Update API to isAccessibilitySupportEnabled

This commit is contained in:
Kevin Sawicki 2016-07-11 14:32:14 -07:00
parent 3fcbac78ac
commit 34f7ddec9f
7 changed files with 16 additions and 13 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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(

View file

@ -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,

View file

@ -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)

View file

@ -84,7 +84,7 @@
ax_state->DisableAccessibility();
}
atom::Browser::Get()->OnAccessibilityChanged();
atom::Browser::Get()->OnAccessibilitySupportChanged();
}
@end

View file

@ -99,7 +99,7 @@ bool NativeWindowViews::PreHandleMSG(
if (axState && !axState->IsAccessibleBrowser()) {
axState->OnScreenReaderDetected();
enabled_a11y_support_ = true;
Browser::Get()->OnAccessibilityChanged();
Browser::Get()->OnAccessibilitySupportChanged();
}
}