diff options
author | sschmitz@chromium.org <sschmitz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-25 14:40:44 +0000 |
---|---|---|
committer | sschmitz@chromium.org <sschmitz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-25 14:40:44 +0000 |
commit | c51fa6d47ff952dd3325118d1001cb6f9ba1ed2b (patch) | |
tree | 72cdc4a5b5e4e602a6c9c02e5c62043587a399e9 /ash | |
parent | 3180fe328b43721986a2605eb43a4dd405968f08 (diff) | |
download | chromium_src-c51fa6d47ff952dd3325118d1001cb6f9ba1ed2b.zip chromium_src-c51fa6d47ff952dd3325118d1001cb6f9ba1ed2b.tar.gz chromium_src-c51fa6d47ff952dd3325118d1001cb6f9ba1ed2b.tar.bz2 |
Make new logout overlay accessible when spoken feedback is turned on
Added accessibility support for spoken language to ExitWarningHandler
(i.e. the popup when the user presses the quit shortcut [ctrl-shift-q])
BUG=242661
R=sky@chromium.org
TEST=manual
(Press Ctrl-Alt-Z to turn on spoken feedback, then Ctrl-Shift-Q)
Review URL: https://chromiumcodereview.appspot.com/15701008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accelerators/exit_warning_handler.cc | 11 | ||||
-rw-r--r-- | ash/ash_strings.grd | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc index 07d87af..4c3e620 100644 --- a/ash/accelerators/exit_warning_handler.cc +++ b/ash/accelerators/exit_warning_handler.cc @@ -12,6 +12,7 @@ #include "base/timer.h" #include "grit/ash_strings.h" #include "ui/aura/root_window.h" +#include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" @@ -56,6 +57,8 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { public: ExitWarningWidgetDelegateView() : text_width_(0), width_(0), height_(0) { text_ = l10n_util::GetStringUTF16(IDS_ASH_EXIT_WARNING_POPUP_TEXT); + accessible_name_ = + l10n_util::GetStringUTF16(IDS_ASH_EXIT_WARNING_POPUP_TEXT_ACCESSIBLE); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); font_ = rb.GetFont(ui::ResourceBundle::LargeFont); text_width_ = font_.GetStringWidth(text_); @@ -81,8 +84,14 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { views::WidgetDelegateView::OnPaint(canvas); } + virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE { + state->name = accessible_name_; + state->role = ui::AccessibilityTypes::ROLE_ALERT; + } + private: base::string16 text_; + base::string16 accessible_name_; gfx::Font font_; int text_width_; int width_; @@ -172,6 +181,8 @@ void ExitWarningHandler::Show() { widget_->SetContentsView(delegate); widget_->GetNativeView()->SetName("ExitWarningWindow"); widget_->Show(); + + delegate->NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); } void ExitWarningHandler::Hide() { diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index ca15ef7..72bb13b 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd @@ -512,6 +512,9 @@ Press Shift + Alt to switch. <message name="IDS_ASH_EXIT_WARNING_POPUP_TEXT" desc="The text of the popup when the user preses the exit shortcut."> Press Ctrl+Shift+Q twice to quit. </message> + <message name="IDS_ASH_EXIT_WARNING_POPUP_TEXT_ACCESSIBLE" desc="The message used by accessibility to indicate the content of the popup when the user preses the exit shortcut."> + Press Control Shift Q twice to quit. + </message> <!-- ChromeOS-specific strings --> <if expr="pp_ifdef('chromeos')"> |