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/default_accessibility_delegate.h" 6 7 #include <limits> 8 9 namespace ash { 10 namespace internal { 11 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 accessibility_alert_(A11Y_ALERT_NONE) { 20 } 21 22 DefaultAccessibilityDelegate::~DefaultAccessibilityDelegate() {} 23 24 bool DefaultAccessibilityDelegate::IsSpokenFeedbackEnabled() const { 25 return spoken_feedback_enabled_; 26 } 27 28 void DefaultAccessibilityDelegate::ToggleHighContrast() { 29 high_contrast_enabled_ = !high_contrast_enabled_; 30 } 31 32 bool DefaultAccessibilityDelegate::IsHighContrastEnabled() const { 33 return high_contrast_enabled_; 34 } 35 36 void DefaultAccessibilityDelegate::SetMagnifierEnabled(bool enabled) { 37 screen_magnifier_enabled_ = enabled; 38 } 39 40 void DefaultAccessibilityDelegate::SetMagnifierType(MagnifierType type) { 41 screen_magnifier_type_ = type; 42 } 43 44 bool DefaultAccessibilityDelegate::IsMagnifierEnabled() const { 45 return screen_magnifier_enabled_; 46 } 47 48 MagnifierType DefaultAccessibilityDelegate::GetMagnifierType() const { 49 return screen_magnifier_type_; 50 } 51 52 void DefaultAccessibilityDelegate::SetLargeCursorEnabled(bool enabled) { 53 large_cursor_enabled_ = enabled; 54 } 55 56 bool DefaultAccessibilityDelegate::IsLargeCursorEnabled() const { 57 return large_cursor_enabled_; 58 } 59 60 void DefaultAccessibilityDelegate::SetAutoclickEnabled(bool enabled) { 61 autoclick_enabled_ = enabled; 62 } 63 64 bool DefaultAccessibilityDelegate::IsAutoclickEnabled() const { 65 return autoclick_enabled_; 66 } 67 68 bool DefaultAccessibilityDelegate::ShouldShowAccessibilityMenu() const { 69 return spoken_feedback_enabled_ || 70 high_contrast_enabled_ || 71 screen_magnifier_enabled_ || 72 large_cursor_enabled_ || 73 autoclick_enabled_; 74 } 75 76 void DefaultAccessibilityDelegate::SilenceSpokenFeedback() const { 77 } 78 79 void DefaultAccessibilityDelegate::ToggleSpokenFeedback( 80 AccessibilityNotificationVisibility notify) { 81 spoken_feedback_enabled_ = !spoken_feedback_enabled_; 82 } 83 84 void DefaultAccessibilityDelegate::SaveScreenMagnifierScale(double scale) { 85 } 86 87 double DefaultAccessibilityDelegate::GetSavedScreenMagnifierScale() { 88 return std::numeric_limits<double>::min(); 89 } 90 91 void DefaultAccessibilityDelegate::TriggerAccessibilityAlert( 92 AccessibilityAlert alert) { 93 accessibility_alert_ = alert; 94 } 95 96 AccessibilityAlert DefaultAccessibilityDelegate::GetLastAccessibilityAlert() { 97 return accessibility_alert_; 98 } 99 100 base::TimeDelta DefaultAccessibilityDelegate::PlayShutdownSound() const { 101 return base::TimeDelta(); 102 } 103 104 } // namespace internal 105 } // namespace ash 106