Update API to isAccessibilitySupportEnabled
This commit is contained in:
parent
3fcbac78ac
commit
34f7ddec9f
7 changed files with 16 additions and 13 deletions
|
@ -282,8 +282,8 @@ void App::OnFinishLaunching() {
|
||||||
Emit("ready");
|
Emit("ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnAccessibilityChanged() {
|
void App::OnAccessibilitySupportChanged() {
|
||||||
Emit("accessibility-changed", IsAccessible());
|
Emit("accessibility-support-changed", IsAccessibilitySupportEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
@ -491,7 +491,7 @@ void App::DisableHardwareAcceleration(mate::Arguments* args) {
|
||||||
content::GpuDataManager::GetInstance()->DisableHardwareAcceleration();
|
content::GpuDataManager::GetInstance()->DisableHardwareAcceleration();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool App::IsAccessible() {
|
bool App::IsAccessibilitySupportEnabled() {
|
||||||
auto ax_state = content::BrowserAccessibilityState::GetInstance();
|
auto ax_state = content::BrowserAccessibilityState::GetInstance();
|
||||||
return ax_state->IsAccessibleBrowser();
|
return ax_state->IsAccessibleBrowser();
|
||||||
}
|
}
|
||||||
|
@ -588,7 +588,8 @@ void App::BuildPrototype(
|
||||||
.SetMethod("makeSingleInstance", &App::MakeSingleInstance)
|
.SetMethod("makeSingleInstance", &App::MakeSingleInstance)
|
||||||
.SetMethod("releaseSingleInstance", &App::ReleaseSingleInstance)
|
.SetMethod("releaseSingleInstance", &App::ReleaseSingleInstance)
|
||||||
.SetMethod("relaunch", &App::Relaunch)
|
.SetMethod("relaunch", &App::Relaunch)
|
||||||
.SetMethod("isAccessible", &App::IsAccessible)
|
.SetMethod("IsAccessibilitySupportEnabled",
|
||||||
|
&App::IsAccessibilitySupportEnabled)
|
||||||
.SetMethod("disableHardwareAcceleration",
|
.SetMethod("disableHardwareAcceleration",
|
||||||
&App::DisableHardwareAcceleration);
|
&App::DisableHardwareAcceleration);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
void OnFinishLaunching() override;
|
void OnFinishLaunching() override;
|
||||||
void OnLogin(LoginHandler* login_handler,
|
void OnLogin(LoginHandler* login_handler,
|
||||||
const base::DictionaryValue& request_details) override;
|
const base::DictionaryValue& request_details) override;
|
||||||
void OnAccessibilityChanged() override;
|
void OnAccessibilitySupportChanged() override;
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
void OnContinueUserActivity(
|
void OnContinueUserActivity(
|
||||||
bool* prevent_default,
|
bool* prevent_default,
|
||||||
|
@ -114,7 +114,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
void ReleaseSingleInstance();
|
void ReleaseSingleInstance();
|
||||||
bool Relaunch(mate::Arguments* args);
|
bool Relaunch(mate::Arguments* args);
|
||||||
void DisableHardwareAcceleration(mate::Arguments* args);
|
void DisableHardwareAcceleration(mate::Arguments* args);
|
||||||
bool IsAccessible();
|
bool IsAccessibilitySupportEnabled();
|
||||||
#if defined(USE_NSS_CERTS)
|
#if defined(USE_NSS_CERTS)
|
||||||
void ImportCertificate(const base::DictionaryValue& options,
|
void ImportCertificate(const base::DictionaryValue& options,
|
||||||
const net::CompletionCallback& callback);
|
const net::CompletionCallback& callback);
|
||||||
|
|
|
@ -155,8 +155,10 @@ void Browser::DidFinishLaunching() {
|
||||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
|
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::OnAccessibilityChanged() {
|
void Browser::OnAccessibilitySupportChanged() {
|
||||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnAccessibilityChanged());
|
FOR_EACH_OBSERVER(BrowserObserver,
|
||||||
|
observers_,
|
||||||
|
OnAccessibilitySupportChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::RequestLogin(
|
void Browser::RequestLogin(
|
||||||
|
|
|
@ -185,7 +185,7 @@ class Browser : public WindowListObserver {
|
||||||
void WillFinishLaunching();
|
void WillFinishLaunching();
|
||||||
void DidFinishLaunching();
|
void DidFinishLaunching();
|
||||||
|
|
||||||
void OnAccessibilityChanged();
|
void OnAccessibilitySupportChanged();
|
||||||
|
|
||||||
// Request basic auth login.
|
// Request basic auth login.
|
||||||
void RequestLogin(LoginHandler* login_handler,
|
void RequestLogin(LoginHandler* login_handler,
|
||||||
|
|
|
@ -52,8 +52,8 @@ class BrowserObserver {
|
||||||
virtual void OnLogin(LoginHandler* login_handler,
|
virtual void OnLogin(LoginHandler* login_handler,
|
||||||
const base::DictionaryValue& request_details) {}
|
const base::DictionaryValue& request_details) {}
|
||||||
|
|
||||||
// The browser's accessibility state has changed.
|
// The browser's accessibility suppport has changed.
|
||||||
virtual void OnAccessibilityChanged() {};
|
virtual void OnAccessibilitySupportChanged() {};
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
// The browser wants to resume a user activity via handoff. (macOS only)
|
// The browser wants to resume a user activity via handoff. (macOS only)
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
ax_state->DisableAccessibility();
|
ax_state->DisableAccessibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
atom::Browser::Get()->OnAccessibilityChanged();
|
atom::Browser::Get()->OnAccessibilitySupportChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -99,7 +99,7 @@ bool NativeWindowViews::PreHandleMSG(
|
||||||
if (axState && !axState->IsAccessibleBrowser()) {
|
if (axState && !axState->IsAccessibleBrowser()) {
|
||||||
axState->OnScreenReaderDetected();
|
axState->OnScreenReaderDetected();
|
||||||
enabled_a11y_support_ = true;
|
enabled_a11y_support_ = true;
|
||||||
Browser::Get()->OnAccessibilityChanged();
|
Browser::Get()->OnAccessibilitySupportChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue