OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/common/system/tray_accessibility.h" | 5 #include "ash/common/system/tray_accessibility.h" |
6 | 6 |
7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
8 #include "ash/common/accessibility_types.h" | 8 #include "ash/common/accessibility_types.h" |
9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ash/strings/grit/ash_strings.h" | 25 #include "ash/strings/grit/ash_strings.h" |
26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
29 #include "ui/gfx/color_palette.h" | 29 #include "ui/gfx/color_palette.h" |
30 #include "ui/gfx/image/image.h" | 30 #include "ui/gfx/image/image.h" |
31 #include "ui/gfx/paint_vector_icon.h" | 31 #include "ui/gfx/paint_vector_icon.h" |
32 #include "ui/views/controls/button/custom_button.h" | 32 #include "ui/views/controls/button/custom_button.h" |
33 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
34 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| 35 #include "ui/views/controls/separator.h" |
35 #include "ui/views/layout/box_layout.h" | 36 #include "ui/views/layout/box_layout.h" |
36 #include "ui/views/widget/widget.h" | 37 #include "ui/views/widget/widget.h" |
37 | 38 |
38 namespace ash { | 39 namespace ash { |
39 namespace { | 40 namespace { |
40 | 41 |
41 enum AccessibilityState { | 42 enum AccessibilityState { |
42 A11Y_NONE = 0, | 43 A11Y_NONE = 0, |
43 A11Y_SPOKEN_FEEDBACK = 1 << 0, | 44 A11Y_SPOKEN_FEEDBACK = 1 << 0, |
44 A11Y_HIGH_CONTRAST = 1 << 1, | 45 A11Y_HIGH_CONTRAST = 1 << 1, |
45 A11Y_SCREEN_MAGNIFIER = 1 << 2, | 46 A11Y_SCREEN_MAGNIFIER = 1 << 2, |
46 A11Y_LARGE_CURSOR = 1 << 3, | 47 A11Y_LARGE_CURSOR = 1 << 3, |
47 A11Y_AUTOCLICK = 1 << 4, | 48 A11Y_AUTOCLICK = 1 << 4, |
48 A11Y_VIRTUAL_KEYBOARD = 1 << 5, | 49 A11Y_VIRTUAL_KEYBOARD = 1 << 5, |
49 A11Y_BRAILLE_DISPLAY_CONNECTED = 1 << 6, | 50 A11Y_BRAILLE_DISPLAY_CONNECTED = 1 << 6, |
| 51 A11Y_MONO_AUDIO = 1 << 7, |
| 52 A11Y_CARET_HIGHLIGHT = 1 << 8, |
| 53 A11Y_HIGHLIGHT_MOUSE_CURSOR = 1 << 9, |
| 54 A11Y_HIGHLIGHT_KEYBOARD_FOCUS = 1 << 10, |
50 }; | 55 }; |
51 | 56 |
52 uint32_t GetAccessibilityState() { | 57 uint32_t GetAccessibilityState() { |
53 AccessibilityDelegate* delegate = | 58 AccessibilityDelegate* delegate = |
54 Shell::GetInstance()->accessibility_delegate(); | 59 Shell::GetInstance()->accessibility_delegate(); |
55 uint32_t state = A11Y_NONE; | 60 uint32_t state = A11Y_NONE; |
56 if (delegate->IsSpokenFeedbackEnabled()) | 61 if (delegate->IsSpokenFeedbackEnabled()) |
57 state |= A11Y_SPOKEN_FEEDBACK; | 62 state |= A11Y_SPOKEN_FEEDBACK; |
58 if (delegate->IsHighContrastEnabled()) | 63 if (delegate->IsHighContrastEnabled()) |
59 state |= A11Y_HIGH_CONTRAST; | 64 state |= A11Y_HIGH_CONTRAST; |
60 if (delegate->IsMagnifierEnabled()) | 65 if (delegate->IsMagnifierEnabled()) |
61 state |= A11Y_SCREEN_MAGNIFIER; | 66 state |= A11Y_SCREEN_MAGNIFIER; |
62 if (delegate->IsLargeCursorEnabled()) | 67 if (delegate->IsLargeCursorEnabled()) |
63 state |= A11Y_LARGE_CURSOR; | 68 state |= A11Y_LARGE_CURSOR; |
64 if (delegate->IsAutoclickEnabled()) | 69 if (delegate->IsAutoclickEnabled()) |
65 state |= A11Y_AUTOCLICK; | 70 state |= A11Y_AUTOCLICK; |
66 if (delegate->IsVirtualKeyboardEnabled()) | 71 if (delegate->IsVirtualKeyboardEnabled()) |
67 state |= A11Y_VIRTUAL_KEYBOARD; | 72 state |= A11Y_VIRTUAL_KEYBOARD; |
68 if (delegate->IsBrailleDisplayConnected()) | 73 if (delegate->IsBrailleDisplayConnected()) |
69 state |= A11Y_BRAILLE_DISPLAY_CONNECTED; | 74 state |= A11Y_BRAILLE_DISPLAY_CONNECTED; |
| 75 if (delegate->IsMonoAudioEnabled()) |
| 76 state |= A11Y_MONO_AUDIO; |
| 77 if (delegate->IsCaretHighlightEnabled()) |
| 78 state |= A11Y_CARET_HIGHLIGHT; |
| 79 if (delegate->IsCursorHighlightEnabled()) |
| 80 state |= A11Y_HIGHLIGHT_MOUSE_CURSOR; |
| 81 if (delegate->IsFocusHighlightEnabled()) |
| 82 state |= A11Y_HIGHLIGHT_KEYBOARD_FOCUS; |
70 return state; | 83 return state; |
71 } | 84 } |
72 | 85 |
73 LoginStatus GetCurrentLoginStatus() { | 86 LoginStatus GetCurrentLoginStatus() { |
74 return Shell::Get()->system_tray_delegate()->GetUserLoginStatus(); | 87 return Shell::Get()->system_tray_delegate()->GetUserLoginStatus(); |
75 } | 88 } |
76 | 89 |
| 90 void UpdateCheckMark(HoverHighlightView* container, bool checked) { |
| 91 if (checked) { |
| 92 gfx::ImageSkia check_mark = |
| 93 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); |
| 94 container->AddRightIcon(check_mark, check_mark.width()); |
| 95 container->SetRightViewVisible(true); |
| 96 container->SetAccessiblityState( |
| 97 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); |
| 98 } else { |
| 99 container->SetAccessiblityState( |
| 100 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); |
| 101 } |
| 102 } |
| 103 |
77 } // namespace | 104 } // namespace |
78 | 105 |
79 namespace tray { | 106 namespace tray { |
80 | 107 |
81 class DefaultAccessibilityView : public TrayItemMore { | 108 class DefaultAccessibilityView : public TrayItemMore { |
82 public: | 109 public: |
83 explicit DefaultAccessibilityView(SystemTrayItem* owner) | 110 explicit DefaultAccessibilityView(SystemTrayItem* owner) |
84 : TrayItemMore(owner) { | 111 : TrayItemMore(owner) { |
85 base::string16 label = | 112 base::string16 label = |
86 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY); | 113 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 159 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
133 return label; | 160 return label; |
134 } | 161 } |
135 | 162 |
136 //////////////////////////////////////////////////////////////////////////////// | 163 //////////////////////////////////////////////////////////////////////////////// |
137 // ash::tray::AccessibilityDetailedView | 164 // ash::tray::AccessibilityDetailedView |
138 | 165 |
139 AccessibilityDetailedView::AccessibilityDetailedView(SystemTrayItem* owner, | 166 AccessibilityDetailedView::AccessibilityDetailedView(SystemTrayItem* owner, |
140 LoginStatus login) | 167 LoginStatus login) |
141 : TrayDetailsView(owner), | 168 : TrayDetailsView(owner), |
142 spoken_feedback_view_(nullptr), | |
143 high_contrast_view_(nullptr), | |
144 screen_magnifier_view_(nullptr), | |
145 large_cursor_view_(nullptr), | |
146 help_view_(nullptr), | |
147 settings_view_(nullptr), | |
148 autoclick_view_(nullptr), | |
149 virtual_keyboard_view_(nullptr), | |
150 spoken_feedback_enabled_(false), | |
151 high_contrast_enabled_(false), | |
152 screen_magnifier_enabled_(false), | |
153 large_cursor_enabled_(false), | |
154 autoclick_enabled_(false), | |
155 virtual_keyboard_enabled_(false), | |
156 login_(login) { | 169 login_(login) { |
157 Reset(); | 170 Reset(); |
158 AppendAccessibilityList(); | 171 AppendAccessibilityList(); |
159 CreateTitleRow(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TITLE); | 172 CreateTitleRow(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TITLE); |
160 Layout(); | 173 Layout(); |
161 } | 174 } |
162 | 175 |
163 void AccessibilityDetailedView::AppendAccessibilityList() { | 176 void AccessibilityDetailedView::AppendAccessibilityList() { |
164 CreateScrollableList(); | 177 CreateScrollableList(); |
165 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 178 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
166 | 179 |
167 AccessibilityDelegate* delegate = | 180 AccessibilityDelegate* delegate = |
168 Shell::GetInstance()->accessibility_delegate(); | 181 Shell::GetInstance()->accessibility_delegate(); |
169 spoken_feedback_enabled_ = delegate->IsSpokenFeedbackEnabled(); | 182 spoken_feedback_enabled_ = delegate->IsSpokenFeedbackEnabled(); |
170 spoken_feedback_view_ = | 183 spoken_feedback_view_ = |
171 AddScrollListItem(bundle.GetLocalizedString( | 184 AddScrollListItem(bundle.GetLocalizedString( |
172 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK), | 185 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SPOKEN_FEEDBACK), |
173 spoken_feedback_enabled_, spoken_feedback_enabled_, | 186 spoken_feedback_enabled_, spoken_feedback_enabled_, |
174 kSystemMenuAccessibilityChromevoxIcon); | 187 kSystemMenuAccessibilityChromevoxIcon); |
175 | 188 |
176 // Large Cursor item is shown only in Login screen. | |
177 if (login_ == LoginStatus::NOT_LOGGED_IN) { | |
178 large_cursor_enabled_ = delegate->IsLargeCursorEnabled(); | |
179 large_cursor_view_ = | |
180 AddScrollListItem(bundle.GetLocalizedString( | |
181 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_LARGE_CURSOR), | |
182 large_cursor_enabled_, large_cursor_enabled_, | |
183 kSystemMenuAccessibilityLargeCursorIcon); | |
184 } | |
185 | |
186 high_contrast_enabled_ = delegate->IsHighContrastEnabled(); | 189 high_contrast_enabled_ = delegate->IsHighContrastEnabled(); |
187 high_contrast_view_ = AddScrollListItem( | 190 high_contrast_view_ = AddScrollListItem( |
188 bundle.GetLocalizedString( | 191 bundle.GetLocalizedString( |
189 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE), | 192 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGH_CONTRAST_MODE), |
190 high_contrast_enabled_, high_contrast_enabled_, | 193 high_contrast_enabled_, high_contrast_enabled_, |
191 kSystemMenuAccessibilityContrastIcon); | 194 kSystemMenuAccessibilityContrastIcon); |
192 screen_magnifier_enabled_ = delegate->IsMagnifierEnabled(); | 195 screen_magnifier_enabled_ = delegate->IsMagnifierEnabled(); |
193 screen_magnifier_view_ = | 196 screen_magnifier_view_ = |
194 AddScrollListItem(bundle.GetLocalizedString( | 197 AddScrollListItem(bundle.GetLocalizedString( |
195 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER), | 198 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_SCREEN_MAGNIFIER), |
196 screen_magnifier_enabled_, screen_magnifier_enabled_, | 199 screen_magnifier_enabled_, screen_magnifier_enabled_, |
197 kSystemMenuAccessibilityScreenMagnifierIcon); | 200 kSystemMenuAccessibilityScreenMagnifierIcon); |
198 | 201 |
199 // Don't show autoclick option at login screen. | 202 autoclick_enabled_ = delegate->IsAutoclickEnabled(); |
200 if (login_ != LoginStatus::NOT_LOGGED_IN) { | 203 autoclick_view_ = AddScrollListItem( |
201 autoclick_enabled_ = delegate->IsAutoclickEnabled(); | 204 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_AUTOCLICK), |
202 autoclick_view_ = AddScrollListItem( | 205 autoclick_enabled_, autoclick_enabled_, |
203 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_AUTOCLICK), | 206 kSystemMenuAccessibilityAutoClickIcon); |
204 autoclick_enabled_, autoclick_enabled_, | |
205 kSystemMenuAccessibilityAutoClickIcon); | |
206 } | |
207 | 207 |
208 virtual_keyboard_enabled_ = delegate->IsVirtualKeyboardEnabled(); | 208 virtual_keyboard_enabled_ = delegate->IsVirtualKeyboardEnabled(); |
209 virtual_keyboard_view_ = | 209 virtual_keyboard_view_ = |
210 AddScrollListItem(bundle.GetLocalizedString( | 210 AddScrollListItem(bundle.GetLocalizedString( |
211 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD), | 211 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD), |
212 virtual_keyboard_enabled_, virtual_keyboard_enabled_, | 212 virtual_keyboard_enabled_, virtual_keyboard_enabled_, |
213 kSystemMenuKeyboardIcon); | 213 kSystemMenuKeyboardIcon); |
| 214 |
| 215 scroll_content()->AddChildView( |
| 216 TrayPopupUtils::CreateListSubHeaderSeparator()); |
| 217 |
| 218 AddSubHeader(l10n_util::GetStringUTF16( |
| 219 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_ADDITIONAL_SETTINGS)); |
| 220 |
| 221 large_cursor_enabled_ = delegate->IsLargeCursorEnabled(); |
| 222 large_cursor_view_ = AddScrollListItemWithoutIcon( |
| 223 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_LARGE_CURSOR), |
| 224 large_cursor_enabled_); |
| 225 |
| 226 mono_audio_enabled_ = delegate->IsMonoAudioEnabled(); |
| 227 mono_audio_view_ = AddScrollListItemWithoutIcon( |
| 228 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_MONO_AUDIO), |
| 229 mono_audio_enabled_); |
| 230 |
| 231 caret_highlight_enabled_ = delegate->IsCaretHighlightEnabled(); |
| 232 caret_highlight_view_ = AddScrollListItemWithoutIcon( |
| 233 bundle.GetLocalizedString( |
| 234 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_CARET_HIGHLIGHT), |
| 235 caret_highlight_enabled_); |
| 236 |
| 237 highlight_mouse_cursor_enabled_ = delegate->IsCursorHighlightEnabled(); |
| 238 highlight_mouse_cursor_view_ = AddScrollListItemWithoutIcon( |
| 239 bundle.GetLocalizedString( |
| 240 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGHLIGHT_MOUSE_CURSOR), |
| 241 highlight_mouse_cursor_enabled_); |
| 242 |
| 243 // Focus highlighting can't be on when spoken feedback is on because |
| 244 // ChromeVox does its own focus highlighting. |
| 245 if (!spoken_feedback_enabled_) { |
| 246 highlight_keyboard_focus_enabled_ = delegate->IsFocusHighlightEnabled(); |
| 247 highlight_keyboard_focus_view_ = AddScrollListItemWithoutIcon( |
| 248 bundle.GetLocalizedString( |
| 249 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_HIGHLIGHT_KEYBOARD_FOCUS), |
| 250 highlight_keyboard_focus_enabled_); |
| 251 } |
214 } | 252 } |
215 | 253 |
216 HoverHighlightView* AccessibilityDetailedView::AddScrollListItem( | 254 HoverHighlightView* AccessibilityDetailedView::AddScrollListItem( |
217 const base::string16& text, | 255 const base::string16& text, |
218 bool highlight, | 256 bool highlight, |
219 bool checked, | 257 bool checked, |
220 const gfx::VectorIcon& icon) { | 258 const gfx::VectorIcon& icon) { |
221 HoverHighlightView* container = new HoverHighlightView(this); | 259 HoverHighlightView* container = new HoverHighlightView(this); |
222 gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor); | 260 gfx::ImageSkia image = CreateVectorIcon(icon, kMenuIconColor); |
223 const int padding = (kMenuButtonSize - image.width()) / 2; | 261 const int padding = (kMenuButtonSize - image.width()) / 2; |
224 container->AddIconAndLabelCustomSize( | 262 container->AddIconAndLabelCustomSize( |
225 image, text, highlight, image.width() + kMenuSeparatorVerticalPadding * 2, | 263 image, text, highlight, image.width() + kMenuSeparatorVerticalPadding * 2, |
226 padding, padding); | 264 padding, padding); |
227 | 265 |
228 if (checked) { | 266 UpdateCheckMark(container, checked); |
229 gfx::ImageSkia check_mark = | |
230 CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); | |
231 container->AddRightIcon(check_mark, check_mark.width()); | |
232 container->SetRightViewVisible(true); | |
233 container->SetAccessiblityState( | |
234 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | |
235 } else { | |
236 container->SetAccessiblityState( | |
237 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | |
238 } | |
239 | 267 |
240 scroll_content()->AddChildView(container); | 268 scroll_content()->AddChildView(container); |
241 return container; | 269 return container; |
242 } | 270 } |
243 | 271 |
| 272 HoverHighlightView* AccessibilityDetailedView::AddScrollListItemWithoutIcon( |
| 273 const base::string16& text, |
| 274 bool checked) { |
| 275 HoverHighlightView* container = new HoverHighlightView(this); |
| 276 container->AddLabelRowMd(text); |
| 277 |
| 278 UpdateCheckMark(container, checked); |
| 279 |
| 280 scroll_content()->AddChildView(container); |
| 281 return container; |
| 282 } |
| 283 |
| 284 void AccessibilityDetailedView::AddSubHeader( |
| 285 const base::string16& header_text) { |
| 286 TriView* header = TrayPopupUtils::CreateSubHeaderRowView(); |
| 287 TrayPopupUtils::ConfigureAsStickyHeader(header); |
| 288 |
| 289 views::Label* label = TrayPopupUtils::CreateDefaultLabel(); |
| 290 label->SetText(header_text); |
| 291 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER); |
| 292 style.SetupLabel(label); |
| 293 header->AddView(TriView::Container::CENTER, label); |
| 294 |
| 295 scroll_content()->AddChildView(header); |
| 296 } |
| 297 |
244 void AccessibilityDetailedView::HandleViewClicked(views::View* view) { | 298 void AccessibilityDetailedView::HandleViewClicked(views::View* view) { |
245 AccessibilityDelegate* delegate = | 299 AccessibilityDelegate* delegate = |
246 Shell::GetInstance()->accessibility_delegate(); | 300 Shell::GetInstance()->accessibility_delegate(); |
247 UserMetricsAction user_action; | 301 UserMetricsAction user_action; |
248 if (view == spoken_feedback_view_) { | 302 if (view == spoken_feedback_view_) { |
249 user_action = delegate->IsSpokenFeedbackEnabled() | 303 user_action = delegate->IsSpokenFeedbackEnabled() |
250 ? ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK | 304 ? ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK |
251 : ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK; | 305 : ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK; |
252 delegate->ToggleSpokenFeedback(A11Y_NOTIFICATION_NONE); | 306 delegate->ToggleSpokenFeedback(A11Y_NOTIFICATION_NONE); |
253 } else if (view == high_contrast_view_) { | 307 } else if (view == high_contrast_view_) { |
(...skipping 14 matching lines...) Expand all Loading... |
268 } else if (autoclick_view_ && view == autoclick_view_) { | 322 } else if (autoclick_view_ && view == autoclick_view_) { |
269 user_action = delegate->IsAutoclickEnabled() | 323 user_action = delegate->IsAutoclickEnabled() |
270 ? ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK | 324 ? ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK |
271 : ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK; | 325 : ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK; |
272 delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled()); | 326 delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled()); |
273 } else if (virtual_keyboard_view_ && view == virtual_keyboard_view_) { | 327 } else if (virtual_keyboard_view_ && view == virtual_keyboard_view_) { |
274 user_action = delegate->IsVirtualKeyboardEnabled() | 328 user_action = delegate->IsVirtualKeyboardEnabled() |
275 ? ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD | 329 ? ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD |
276 : ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD; | 330 : ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD; |
277 delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); | 331 delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); |
| 332 } else if (caret_highlight_view_ && view == caret_highlight_view_) { |
| 333 user_action = delegate->IsCaretHighlightEnabled() |
| 334 ? ash::UMA_STATUS_AREA_DISABLE_CARET_HIGHLIGHT |
| 335 : ash::UMA_STATUS_AREA_ENABLE_CARET_HIGHLIGHT; |
| 336 delegate->SetCaretHighlightEnabled(!delegate->IsCaretHighlightEnabled()); |
| 337 } else if (mono_audio_view_ && view == mono_audio_view_) { |
| 338 user_action = delegate->IsMonoAudioEnabled() |
| 339 ? ash::UMA_STATUS_AREA_DISABLE_MONO_AUDIO |
| 340 : ash::UMA_STATUS_AREA_ENABLE_MONO_AUDIO; |
| 341 delegate->SetMonoAudioEnabled(!delegate->IsMonoAudioEnabled()); |
| 342 } else if (highlight_mouse_cursor_view_ && |
| 343 view == highlight_mouse_cursor_view_) { |
| 344 user_action = delegate->IsCursorHighlightEnabled() |
| 345 ? ash::UMA_STATUS_AREA_DISABLE_HIGHLIGHT_MOUSE_CURSOR |
| 346 : ash::UMA_STATUS_AREA_ENABLE_HIGHLIGHT_MOUSE_CURSOR; |
| 347 delegate->SetCursorHighlightEnabled(!delegate->IsCursorHighlightEnabled()); |
| 348 } else if (highlight_keyboard_focus_view_ && |
| 349 view == highlight_keyboard_focus_view_) { |
| 350 user_action = delegate->IsFocusHighlightEnabled() |
| 351 ? ash::UMA_STATUS_AREA_DISABLE_HIGHLIGHT_KEYBOARD_FOCUS |
| 352 : ash::UMA_STATUS_AREA_ENABLE_HIGHLIGHT_KEYBOARD_FOCUS; |
| 353 delegate->SetFocusHighlightEnabled(!delegate->IsFocusHighlightEnabled()); |
278 } else { | 354 } else { |
279 return; | 355 return; |
280 } | 356 } |
281 WmShell::Get()->RecordUserMetricsAction(user_action); | 357 WmShell::Get()->RecordUserMetricsAction(user_action); |
282 } | 358 } |
283 | 359 |
284 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender, | 360 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender, |
285 const ui::Event& event) { | 361 const ui::Event& event) { |
286 if (sender == help_view_) | 362 if (sender == help_view_) |
287 ShowHelp(); | 363 ShowHelp(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 if (detailed_popup_) | 515 if (detailed_popup_) |
440 detailed_popup_->GetWidget()->Close(); | 516 detailed_popup_->GetWidget()->Close(); |
441 if (detailed_menu_) | 517 if (detailed_menu_) |
442 detailed_menu_->GetWidget()->Close(); | 518 detailed_menu_->GetWidget()->Close(); |
443 } | 519 } |
444 | 520 |
445 previous_accessibility_state_ = accessibility_state; | 521 previous_accessibility_state_ = accessibility_state; |
446 } | 522 } |
447 | 523 |
448 } // namespace ash | 524 } // namespace ash |
OLD | NEW |