1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/default_accessibility_delegate.h"
12 DefaultAccessibilityDelegate::DefaultAccessibilityDelegate()
13 : spoken_feedback_enabled_(false),
14 high_contrast_enabled_(false),
15 screen_magnifier_enabled_(false),
16 screen_magnifier_type_(kDefaultMagnifierType
),
17 large_cursor_enabled_(false),
18 autoclick_enabled_(false),
19 virtual_keyboard_enabled_(false),
20 accessibility_alert_(A11Y_ALERT_NONE
) {
23 DefaultAccessibilityDelegate::~DefaultAccessibilityDelegate() {}
25 bool DefaultAccessibilityDelegate::IsSpokenFeedbackEnabled() const {
26 return spoken_feedback_enabled_
;
29 void DefaultAccessibilityDelegate::ToggleHighContrast() {
30 high_contrast_enabled_
= !high_contrast_enabled_
;
33 bool DefaultAccessibilityDelegate::IsHighContrastEnabled() const {
34 return high_contrast_enabled_
;
37 void DefaultAccessibilityDelegate::SetMagnifierEnabled(bool enabled
) {
38 screen_magnifier_enabled_
= enabled
;
41 void DefaultAccessibilityDelegate::SetMagnifierType(MagnifierType type
) {
42 screen_magnifier_type_
= type
;
45 bool DefaultAccessibilityDelegate::IsMagnifierEnabled() const {
46 return screen_magnifier_enabled_
;
49 MagnifierType
DefaultAccessibilityDelegate::GetMagnifierType() const {
50 return screen_magnifier_type_
;
53 void DefaultAccessibilityDelegate::SetLargeCursorEnabled(bool enabled
) {
54 large_cursor_enabled_
= enabled
;
57 bool DefaultAccessibilityDelegate::IsLargeCursorEnabled() const {
58 return large_cursor_enabled_
;
61 void DefaultAccessibilityDelegate::SetAutoclickEnabled(bool enabled
) {
62 autoclick_enabled_
= enabled
;
65 bool DefaultAccessibilityDelegate::IsAutoclickEnabled() const {
66 return autoclick_enabled_
;
69 void DefaultAccessibilityDelegate::SetVirtualKeyboardEnabled(bool enabled
) {
70 virtual_keyboard_enabled_
= enabled
;
73 bool DefaultAccessibilityDelegate::IsVirtualKeyboardEnabled() const {
74 return virtual_keyboard_enabled_
;
77 bool DefaultAccessibilityDelegate::ShouldShowAccessibilityMenu() const {
78 return spoken_feedback_enabled_
||
79 high_contrast_enabled_
||
80 screen_magnifier_enabled_
||
81 large_cursor_enabled_
||
83 virtual_keyboard_enabled_
;
86 void DefaultAccessibilityDelegate::SilenceSpokenFeedback() const {
89 void DefaultAccessibilityDelegate::ToggleSpokenFeedback(
90 AccessibilityNotificationVisibility notify
) {
91 spoken_feedback_enabled_
= !spoken_feedback_enabled_
;
94 void DefaultAccessibilityDelegate::SaveScreenMagnifierScale(double scale
) {
97 double DefaultAccessibilityDelegate::GetSavedScreenMagnifierScale() {
98 return std::numeric_limits
<double>::min();
101 void DefaultAccessibilityDelegate::TriggerAccessibilityAlert(
102 AccessibilityAlert alert
) {
103 accessibility_alert_
= alert
;
106 AccessibilityAlert
DefaultAccessibilityDelegate::GetLastAccessibilityAlert() {
107 return accessibility_alert_
;
110 base::TimeDelta
DefaultAccessibilityDelegate::PlayShutdownSound() const {
111 return base::TimeDelta();
114 } // namespace internal