diff options
-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 | ||||
-rw-r--r-- | chrome/browser/chromeos/system/tray_accessibility_browsertest.cc | 133 | ||||
-rw-r--r-- | chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/ash/chrome_shell_delegate_views.cc | 3 |
11 files changed, 172 insertions, 15 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; diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc index f4b072ef..e7f1ef4 100644 --- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc +++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc @@ -146,24 +146,31 @@ class TrayAccessibilityTest void ClickSpokenFeedbackOnDetailMenu() { views::View* button = tray()->detailed_menu_->spoken_feedback_view_; + ASSERT_TRUE(button); tray()->detailed_menu_->OnViewClicked(button); } void ClickHighContrastOnDetailMenu() { views::View* button = tray()->detailed_menu_->high_contrast_view_; - EXPECT_TRUE(button); + ASSERT_TRUE(button); tray()->detailed_menu_->OnViewClicked(button); } void ClickScreenMagnifierOnDetailMenu() { views::View* button = tray()->detailed_menu_->screen_magnifier_view_; - EXPECT_TRUE(button); + ASSERT_TRUE(button); tray()->detailed_menu_->OnViewClicked(button); } void ClickAutoclickOnDetailMenu() { views::View* button = tray()->detailed_menu_->autoclick_view_; - EXPECT_TRUE(button); + ASSERT_TRUE(button); + tray()->detailed_menu_->OnViewClicked(button); + } + + void ClickVirtualKeyboardOnDetailMenu() { + views::View* button = tray()->detailed_menu_->virtual_keyboard_view_; + ASSERT_TRUE(button); tray()->detailed_menu_->OnViewClicked(button); } @@ -186,6 +193,11 @@ class TrayAccessibilityTest bool IsAutoclickEnabledOnDetailMenu() { return tray()->detailed_menu_->autoclick_enabled_; } + + bool IsVirtualKeyboardEnabledOnDetailMenu() { + return tray()->detailed_menu_->virtual_keyboard_enabled_; + } + bool IsSpokenFeedbackMenuShownOnDetailMenu() { return tray()->detailed_menu_->spoken_feedback_view_; } @@ -206,6 +218,10 @@ class TrayAccessibilityTest return tray()->detailed_menu_->autoclick_view_; } + bool IsVirtualKeyboardMenuShownOnDetailMenu() { + return tray()->detailed_menu_->virtual_keyboard_view_; + } + policy::MockConfigurationPolicyProvider provider_; }; @@ -252,6 +268,13 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { SetMagnifierEnabled(false); EXPECT_FALSE(IsTrayIconVisible()); + // Toggling the virtual keyboard setting changes the visibility of the a11y + // icon. + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(IsTrayIconVisible()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_FALSE(IsTrayIconVisible()); + // Enabling all accessibility features. SetMagnifierEnabled(true); EXPECT_TRUE(IsTrayIconVisible()); @@ -260,12 +283,16 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(IsTrayIconVisible()); + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(IsTrayIconVisible()); AccessibilityManager::Get()->EnableSpokenFeedback( false, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(IsTrayIconVisible()); AccessibilityManager::Get()->EnableHighContrast(false); EXPECT_TRUE(IsTrayIconVisible()); SetMagnifierEnabled(false); + EXPECT_TRUE(IsTrayIconVisible()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); EXPECT_FALSE(IsTrayIconVisible()); // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect @@ -314,6 +341,12 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { AccessibilityManager::Get()->EnableAutoclick(false); EXPECT_FALSE(CanCreateMenuItem()); + // Toggling virtual keyboard changes the visibility of the menu. + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_FALSE(CanCreateMenuItem()); + // Enabling all accessibility features. SetMagnifierEnabled(true); EXPECT_TRUE(CanCreateMenuItem()); @@ -324,6 +357,10 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableAutoclick(true); EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableAutoclick(false); EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableSpokenFeedback( @@ -346,7 +383,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { // Confirms that the menu is visible. EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling spoken feedback. + // The menu remains visible regardless of toggling spoken feedback. AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); @@ -354,24 +391,30 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { false, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling high contrast. + // The menu remains visible regardless of toggling high contrast. AccessibilityManager::Get()->EnableHighContrast(true); EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableHighContrast(false); EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling screen magnifier. + // The menu remains visible regardless of toggling screen magnifier. SetMagnifierEnabled(true); EXPECT_TRUE(CanCreateMenuItem()); SetMagnifierEnabled(false); EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling autoclick. + // The menu remains visible regardless of toggling autoclick. AccessibilityManager::Get()->EnableAutoclick(true); EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableAutoclick(false); EXPECT_TRUE(CanCreateMenuItem()); + // The menu remains visible regardless of toggling on-screen keyboard. + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CanCreateMenuItem()); + // Enabling all accessibility features. SetMagnifierEnabled(true); EXPECT_TRUE(CanCreateMenuItem()); @@ -382,6 +425,10 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableAutoclick(true); EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableAutoclick(false); EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableSpokenFeedback( @@ -404,7 +451,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { // Confirms that the menu is visible. EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling spoken feedback. + // The menu remains visible regardless of toggling spoken feedback. AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); @@ -412,18 +459,24 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { false, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling high contrast. + // The menu remains visible regardless of toggling high contrast. AccessibilityManager::Get()->EnableHighContrast(true); EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableHighContrast(false); EXPECT_TRUE(CanCreateMenuItem()); - // The menu is keeping visible regardless of toggling screen magnifier. + // The menu remains visible regardless of toggling screen magnifier. SetMagnifierEnabled(true); EXPECT_TRUE(CanCreateMenuItem()); SetMagnifierEnabled(false); EXPECT_TRUE(CanCreateMenuItem()); + // The menu remains visible regardless of toggling on-screen keyboard. + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CanCreateMenuItem()); + // Enabling all accessibility features. SetMagnifierEnabled(true); EXPECT_TRUE(CanCreateMenuItem()); @@ -432,6 +485,10 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { AccessibilityManager::Get()->EnableSpokenFeedback( true, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CanCreateMenuItem()); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CanCreateMenuItem()); AccessibilityManager::Get()->EnableSpokenFeedback( false, ash::A11Y_NOTIFICATION_NONE); EXPECT_TRUE(CanCreateMenuItem()); @@ -442,12 +499,12 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { SetShowAccessibilityOptionsInSystemTrayMenu(true); - // Confirms that the menu is keeping visible. + // Confirms that the menu remains visible. EXPECT_TRUE(CanCreateMenuItem()); SetShowAccessibilityOptionsInSystemTrayMenu(false); - // Confirms that the menu is keeping visible. + // Confirms that the menu remains visible. EXPECT_TRUE(CanCreateMenuItem()); } @@ -518,6 +575,17 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, MAYBE_ClickDetailMenu) { EXPECT_TRUE(CreateDetailedMenu()); ClickAutoclickOnDetailMenu(); EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled()); + + // Confirms that the check item toggles on-screen keyboard. + EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); + + EXPECT_TRUE(CreateDetailedMenu()); + ClickVirtualKeyboardOnDetailMenu(); + EXPECT_TRUE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); + + EXPECT_TRUE(CreateDetailedMenu()); + ClickVirtualKeyboardOnDetailMenu(); + EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); } IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { @@ -530,7 +598,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); - EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Enabling spoken feedback. @@ -542,6 +610,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling spoken feedback. @@ -553,6 +622,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Enabling high contrast. @@ -563,6 +633,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling high contrast. @@ -573,6 +644,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Enabling full screen magnifier. @@ -583,6 +655,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling screen magnifier. @@ -593,6 +666,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Enabling large cursor. @@ -603,6 +677,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling large cursor. @@ -613,6 +688,29 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); + CloseDetailMenu(); + + // Enable on-screen keyboard. + AccessibilityManager::Get()->EnableVirtualKeyboard(true); + EXPECT_TRUE(CreateDetailedMenu()); + EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); + EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); + EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); + EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); + EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu()); + CloseDetailMenu(); + + // Disable on-screen keyboard. + AccessibilityManager::Get()->EnableVirtualKeyboard(false); + EXPECT_TRUE(CreateDetailedMenu()); + EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); + EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); + EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); + EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); + EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Enabling all of the a11y features. @@ -621,12 +719,14 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { AccessibilityManager::Get()->EnableHighContrast(true); SetMagnifierEnabled(true); AccessibilityManager::Get()->EnableLargeCursor(true); + AccessibilityManager::Get()->EnableVirtualKeyboard(true); EXPECT_TRUE(CreateDetailedMenu()); EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling all of the a11y features. @@ -635,12 +735,14 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { AccessibilityManager::Get()->EnableHighContrast(false); SetMagnifierEnabled(false); AccessibilityManager::Get()->EnableLargeCursor(false); + AccessibilityManager::Get()->EnableVirtualKeyboard(false); EXPECT_TRUE(CreateDetailedMenu()); EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Autoclick is disabled on login screen. @@ -654,6 +756,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); // Disabling autoclick. @@ -664,6 +767,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); + EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); CloseDetailMenu(); } @@ -675,6 +779,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu()); EXPECT_FALSE(IsAutoclickMenuShownOnDetailMenu()); + EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); CloseDetailMenu(); SetLoginStatus(ash::user::LOGGED_IN_USER); @@ -684,6 +789,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); EXPECT_FALSE(IsLargeCursorMenuShownOnDetailMenu()); EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); + EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); CloseDetailMenu(); SetLoginStatus(ash::user::LOGGED_IN_LOCKED); @@ -693,6 +799,7 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); EXPECT_FALSE(IsLargeCursorMenuShownOnDetailMenu()); EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); + EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); CloseDetailMenu(); } diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc index e567dfb..11c5ee9 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc @@ -119,6 +119,12 @@ class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { return chromeos::AccessibilityManager::Get()->IsAutoclickEnabled(); } + virtual void SetVirtualKeyboardEnabled(bool enabled) OVERRIDE { + DCHECK(chromeos::AccessibilityManager::Get()); + return chromeos::AccessibilityManager::Get()-> + EnableVirtualKeyboard(enabled); + } + virtual bool IsVirtualKeyboardEnabled() const OVERRIDE { DCHECK(chromeos::AccessibilityManager::Get()); return chromeos::AccessibilityManager::Get()->IsVirtualKeyboardEnabled(); diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_views.cc b/chrome/browser/ui/ash/chrome_shell_delegate_views.cc index 0580ea4..7a96d72 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_views.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_views.cc @@ -123,6 +123,9 @@ class EmptyAccessibilityDelegate : public ash::AccessibilityDelegate { virtual void SilenceSpokenFeedback() const OVERRIDE { } + virtual void SetVirtualKeyboardEnabled(bool enabled) OVERRIDE { + } + virtual bool IsVirtualKeyboardEnabled() const OVERRIDE { return false; } |