diff options
author | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 17:18:07 +0000 |
---|---|---|
committer | kevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 17:18:07 +0000 |
commit | abdd0d71f2f33c0ba31c319c30b9e5b069776458 (patch) | |
tree | ae608e0f2d4198a98e91c077ee726bc6291ef328 /ash | |
parent | 46116d36e1fcd5b60acadf718fee9751502b429a (diff) | |
download | chromium_src-abdd0d71f2f33c0ba31c319c30b9e5b069776458.zip chromium_src-abdd0d71f2f33c0ba31c319c30b9e5b069776458.tar.gz chromium_src-abdd0d71f2f33c0ba31c319c30b9e5b069776458.tar.bz2 |
Add a11y on-screen keyboard to accessibility menu on system tray.
BUG=340760
Review URL: https://codereview.chromium.org/137993021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accessibility_delegate.h | 3 | ||||
-rw-r--r-- | ash/ash_strings.grd | 3 | ||||
-rw-r--r-- | ash/default_accessibility_delegate.cc | 10 | ||||
-rw-r--r-- | ash/default_accessibility_delegate.h | 2 | ||||
-rw-r--r-- | ash/metrics/user_metrics_recorder.cc | 8 | ||||
-rw-r--r-- | ash/metrics/user_metrics_recorder.h | 2 | ||||
-rw-r--r-- | ash/system/tray_accessibility.cc | 15 | ||||
-rw-r--r-- | ash/system/tray_accessibility.h | 2 |
8 files changed, 43 insertions, 2 deletions
diff --git a/ash/accessibility_delegate.h b/ash/accessibility_delegate.h index 8d4b932..037a40f 100644 --- a/ash/accessibility_delegate.h +++ b/ash/accessibility_delegate.h @@ -63,6 +63,9 @@ class ASH_EXPORT AccessibilityDelegate { // Returns if autoclick is enabled or not. virtual bool IsAutoclickEnabled() const = 0; + // Invoked to enable or disable the a11y on-screen keyboard. + virtual void SetVirtualKeyboardEnabled(bool enabled) = 0; + // Returns if the a11y virtual keyboard is enabled. virtual bool IsVirtualKeyboardEnabled() const = 0; diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index a31da85..84084aa 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd @@ -442,6 +442,9 @@ Press Shift + Alt to switch. <message name="IDS_ASH_STATUS_TRAY_ACCESSIBILITY_AUTOCLICK" desc="The label used in the accessibility menu of the system tray to toggle on/off automatic mouse clicks."> Automatic clicks </message> + <message name="IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD" desc="The label used in the accessibility menu of the system tray to toggle on/off the onscreen keyboard."> + On-screen keyboard + </message> <message name="IDS_ASH_STATUS_TRAY_ACCESSIBILITY_LEARN_MORE" desc="The label used in the accessibility menu of the system tray to open a webpage (article on help center) containing explanation about accessibility feature."> Learn more... diff --git a/ash/default_accessibility_delegate.cc b/ash/default_accessibility_delegate.cc index 94a3d30..975c3b6 100644 --- a/ash/default_accessibility_delegate.cc +++ b/ash/default_accessibility_delegate.cc @@ -16,6 +16,7 @@ DefaultAccessibilityDelegate::DefaultAccessibilityDelegate() screen_magnifier_type_(kDefaultMagnifierType), large_cursor_enabled_(false), autoclick_enabled_(false), + virtual_keyboard_enabled_(false), accessibility_alert_(A11Y_ALERT_NONE) { } @@ -65,8 +66,12 @@ bool DefaultAccessibilityDelegate::IsAutoclickEnabled() const { return autoclick_enabled_; } +void DefaultAccessibilityDelegate::SetVirtualKeyboardEnabled(bool enabled) { + virtual_keyboard_enabled_ = enabled; +} + bool DefaultAccessibilityDelegate::IsVirtualKeyboardEnabled() const { - return false; + return virtual_keyboard_enabled_; } bool DefaultAccessibilityDelegate::ShouldShowAccessibilityMenu() const { @@ -74,7 +79,8 @@ bool DefaultAccessibilityDelegate::ShouldShowAccessibilityMenu() const { high_contrast_enabled_ || screen_magnifier_enabled_ || large_cursor_enabled_ || - autoclick_enabled_; + autoclick_enabled_ || + virtual_keyboard_enabled_; } void DefaultAccessibilityDelegate::SilenceSpokenFeedback() const { diff --git a/ash/default_accessibility_delegate.h b/ash/default_accessibility_delegate.h index ad0b684..6254218 100644 --- a/ash/default_accessibility_delegate.h +++ b/ash/default_accessibility_delegate.h @@ -29,6 +29,7 @@ class ASH_EXPORT DefaultAccessibilityDelegate : public AccessibilityDelegate { virtual bool IsLargeCursorEnabled() const OVERRIDE; virtual void SetAutoclickEnabled(bool enabled) OVERRIDE; virtual bool IsAutoclickEnabled() const OVERRIDE; + virtual void SetVirtualKeyboardEnabled(bool enabled) OVERRIDE; virtual bool IsVirtualKeyboardEnabled() const OVERRIDE; virtual bool ShouldShowAccessibilityMenu() const OVERRIDE; virtual void SilenceSpokenFeedback() const OVERRIDE; @@ -47,6 +48,7 @@ class ASH_EXPORT DefaultAccessibilityDelegate : public AccessibilityDelegate { MagnifierType screen_magnifier_type_; bool large_cursor_enabled_; bool autoclick_enabled_; + bool virtual_keyboard_enabled_; AccessibilityAlert accessibility_alert_; DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityDelegate); }; diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc index 238fd61..4d49e92 100644 --- a/ash/metrics/user_metrics_recorder.cc +++ b/ash/metrics/user_metrics_recorder.cc @@ -224,6 +224,10 @@ void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) { base::RecordAction( base::UserMetricsAction("StatusArea_SpokenFeedbackDisabled")); break; + case ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD: + base::RecordAction( + base::UserMetricsAction("StatusArea_VirtualKeyboardDisabled")); + break; case ash::UMA_STATUS_AREA_DISABLE_WIFI: base::RecordAction( base::UserMetricsAction("StatusArea_Network_WifiDisabled")); @@ -256,6 +260,10 @@ void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) { base::RecordAction( base::UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); break; + case ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD: + base::RecordAction( + base::UserMetricsAction("StatusArea_VirtualKeyboardEnabled")); + break; case ash::UMA_STATUS_AREA_ENABLE_WIFI: base::RecordAction( base::UserMetricsAction("StatusArea_Network_WifiEnabled")); diff --git a/ash/metrics/user_metrics_recorder.h b/ash/metrics/user_metrics_recorder.h index 1f2a012..618b70f 100644 --- a/ash/metrics/user_metrics_recorder.h +++ b/ash/metrics/user_metrics_recorder.h @@ -63,6 +63,7 @@ enum UserMetricsAction { UMA_STATUS_AREA_DISABLE_MAGNIFIER, UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK, UMA_STATUS_AREA_DISABLE_WIFI, + UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD, UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION, UMA_STATUS_AREA_DRIVE_SETTINGS, UMA_STATUS_AREA_ENABLE_AUTO_CLICK, @@ -71,6 +72,7 @@ enum UserMetricsAction { UMA_STATUS_AREA_ENABLE_MAGNIFIER, UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK, UMA_STATUS_AREA_ENABLE_WIFI, + UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD, UMA_STATUS_AREA_IME_SHOW_DETAILED, UMA_STATUS_AREA_IME_SWITCH_MODE, UMA_STATUS_AREA_MENU_OPENED, diff --git a/ash/system/tray_accessibility.cc b/ash/system/tray_accessibility.cc index 3ce65bf..4e94408 100644 --- a/ash/system/tray_accessibility.cc +++ b/ash/system/tray_accessibility.cc @@ -121,11 +121,13 @@ AccessibilityDetailedView::AccessibilityDetailedView( help_view_(NULL), settings_view_(NULL), autoclick_view_(NULL), + virtual_keyboard_view_(NULL), spoken_feedback_enabled_(false), high_contrast_enabled_(false), screen_magnifier_enabled_(false), large_cursor_enabled_(false), autoclick_enabled_(false), + virtual_keyboard_enabled_(false), login_(login) { Reset(); @@ -182,6 +184,13 @@ void AccessibilityDetailedView::AppendAccessibilityList() { autoclick_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL, autoclick_enabled_); } + + virtual_keyboard_enabled_ = delegate->IsVirtualKeyboardEnabled(); + virtual_keyboard_view_ = AddScrollListItem( + bundle.GetLocalizedString( + IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD), + virtual_keyboard_enabled_ ? gfx::Font::BOLD : gfx::Font::NORMAL, + virtual_keyboard_enabled_); } void AccessibilityDetailedView::AppendHelpEntries() { @@ -264,6 +273,12 @@ void AccessibilityDetailedView::OnViewClicked(views::View* sender) { ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK : ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK); delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled()); + } else if (virtual_keyboard_view_ && sender == virtual_keyboard_view_) { + Shell::GetInstance()->metrics()->RecordUserMetricsAction( + delegate->IsVirtualKeyboardEnabled() ? + ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD : + ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD); + delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); } } diff --git a/ash/system/tray_accessibility.h b/ash/system/tray_accessibility.h index a3f53cb..21396e5 100644 --- a/ash/system/tray_accessibility.h +++ b/ash/system/tray_accessibility.h @@ -77,12 +77,14 @@ class AccessibilityDetailedView : public TrayDetailsView, views::View* help_view_; views::View* settings_view_; views::View* autoclick_view_; + views::View* virtual_keyboard_view_; bool spoken_feedback_enabled_; bool high_contrast_enabled_; bool screen_magnifier_enabled_; bool large_cursor_enabled_; bool autoclick_enabled_; + bool virtual_keyboard_enabled_; user::LoginStatus login_; friend class chromeos::TrayAccessibilityTest; |