OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "ash/common/default_accessibility_delegate.h" | |
6 | |
7 #include <limits> | |
8 | |
9 namespace ash { | |
10 | |
11 DefaultAccessibilityDelegate::DefaultAccessibilityDelegate() {} | |
12 | |
13 DefaultAccessibilityDelegate::~DefaultAccessibilityDelegate() {} | |
14 | |
15 bool DefaultAccessibilityDelegate::IsSpokenFeedbackEnabled() const { | |
16 return spoken_feedback_enabled_; | |
17 } | |
18 | |
19 void DefaultAccessibilityDelegate::ToggleHighContrast() { | |
20 high_contrast_enabled_ = !high_contrast_enabled_; | |
21 } | |
22 | |
23 bool DefaultAccessibilityDelegate::IsHighContrastEnabled() const { | |
24 return high_contrast_enabled_; | |
25 } | |
26 | |
27 void DefaultAccessibilityDelegate::SetMagnifierEnabled(bool enabled) { | |
28 screen_magnifier_enabled_ = enabled; | |
29 } | |
30 | |
31 void DefaultAccessibilityDelegate::SetMagnifierType(MagnifierType type) { | |
32 screen_magnifier_type_ = type; | |
33 } | |
34 | |
35 bool DefaultAccessibilityDelegate::IsMagnifierEnabled() const { | |
36 return screen_magnifier_enabled_; | |
37 } | |
38 | |
39 MagnifierType DefaultAccessibilityDelegate::GetMagnifierType() const { | |
40 return screen_magnifier_type_; | |
41 } | |
42 | |
43 void DefaultAccessibilityDelegate::SetLargeCursorEnabled(bool enabled) { | |
44 large_cursor_enabled_ = enabled; | |
45 } | |
46 | |
47 bool DefaultAccessibilityDelegate::IsLargeCursorEnabled() const { | |
48 return large_cursor_enabled_; | |
49 } | |
50 | |
51 void DefaultAccessibilityDelegate::SetAutoclickEnabled(bool enabled) { | |
52 autoclick_enabled_ = enabled; | |
53 } | |
54 | |
55 bool DefaultAccessibilityDelegate::IsAutoclickEnabled() const { | |
56 return autoclick_enabled_; | |
57 } | |
58 | |
59 void DefaultAccessibilityDelegate::SetVirtualKeyboardEnabled(bool enabled) { | |
60 virtual_keyboard_enabled_ = enabled; | |
61 } | |
62 | |
63 bool DefaultAccessibilityDelegate::IsVirtualKeyboardEnabled() const { | |
64 return virtual_keyboard_enabled_; | |
65 } | |
66 | |
67 void DefaultAccessibilityDelegate::SetMonoAudioEnabled(bool enabled) { | |
68 mono_audio_enabled_ = enabled; | |
69 } | |
70 | |
71 bool DefaultAccessibilityDelegate::IsMonoAudioEnabled() const { | |
72 return mono_audio_enabled_; | |
73 } | |
74 | |
75 void DefaultAccessibilityDelegate::SetCaretHighlightEnabled(bool enabled) { | |
76 caret_highlight_enabled_ = enabled; | |
77 } | |
78 | |
79 bool DefaultAccessibilityDelegate::IsCaretHighlightEnabled() const { | |
80 return caret_highlight_enabled_; | |
81 } | |
82 | |
83 void DefaultAccessibilityDelegate::SetCursorHighlightEnabled(bool enabled) { | |
84 cursor_highlight_enabled_ = enabled; | |
85 } | |
86 | |
87 bool DefaultAccessibilityDelegate::IsCursorHighlightEnabled() const { | |
88 return cursor_highlight_enabled_; | |
89 } | |
90 | |
91 void DefaultAccessibilityDelegate::SetFocusHighlightEnabled(bool enabled) { | |
92 focus_highligh_enabled_ = enabled; | |
93 } | |
94 | |
95 bool DefaultAccessibilityDelegate::IsFocusHighlightEnabled() const { | |
96 return focus_highligh_enabled_; | |
97 } | |
98 | |
99 void DefaultAccessibilityDelegate::SetSelectToSpeakEnabled(bool enabled) { | |
100 select_to_speak_enabled_ = enabled; | |
101 } | |
102 | |
103 bool DefaultAccessibilityDelegate::IsSelectToSpeakEnabled() const { | |
104 return select_to_speak_enabled_; | |
105 } | |
106 | |
107 void DefaultAccessibilityDelegate::SetSwitchAccessEnabled(bool enabled) { | |
108 switch_access_enabled_ = enabled; | |
109 } | |
110 | |
111 bool DefaultAccessibilityDelegate::IsSwitchAccessEnabled() const { | |
112 return switch_access_enabled_; | |
113 } | |
114 | |
115 bool DefaultAccessibilityDelegate::ShouldShowAccessibilityMenu() const { | |
116 return spoken_feedback_enabled_ || high_contrast_enabled_ || | |
117 screen_magnifier_enabled_ || large_cursor_enabled_ || | |
118 autoclick_enabled_ || virtual_keyboard_enabled_ || mono_audio_enabled_; | |
119 } | |
120 | |
121 bool DefaultAccessibilityDelegate::IsBrailleDisplayConnected() const { | |
122 return false; | |
123 } | |
124 | |
125 void DefaultAccessibilityDelegate::SilenceSpokenFeedback() const {} | |
126 | |
127 void DefaultAccessibilityDelegate::ClearFocusHighlight() const {} | |
128 | |
129 void DefaultAccessibilityDelegate::ToggleSpokenFeedback( | |
130 AccessibilityNotificationVisibility notify) { | |
131 spoken_feedback_enabled_ = !spoken_feedback_enabled_; | |
132 } | |
133 | |
134 void DefaultAccessibilityDelegate::SaveScreenMagnifierScale(double scale) {} | |
135 | |
136 double DefaultAccessibilityDelegate::GetSavedScreenMagnifierScale() { | |
137 return std::numeric_limits<double>::min(); | |
138 } | |
139 | |
140 void DefaultAccessibilityDelegate::TriggerAccessibilityAlert( | |
141 AccessibilityAlert alert) { | |
142 accessibility_alert_ = alert; | |
143 } | |
144 | |
145 AccessibilityAlert DefaultAccessibilityDelegate::GetLastAccessibilityAlert() { | |
146 return accessibility_alert_; | |
147 } | |
148 | |
149 bool DefaultAccessibilityDelegate::ShouldToggleSpokenFeedbackViaTouch() { | |
150 return false; | |
151 } | |
152 | |
153 void DefaultAccessibilityDelegate::PlaySpokenFeedbackToggleCountdown( | |
154 int tick_count) {} | |
155 | |
156 void DefaultAccessibilityDelegate::PlayEarcon(int sound_key) {} | |
157 | |
158 base::TimeDelta DefaultAccessibilityDelegate::PlayShutdownSound() const { | |
159 return base::TimeDelta(); | |
160 } | |
161 | |
162 void DefaultAccessibilityDelegate::HandleAccessibilityGesture( | |
163 ui::AXGesture gesture) {} | |
164 | |
165 } // namespace ash | |
OLD | NEW |