summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 21:15:45 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-17 21:15:45 +0000
commit85ee5bb142b5a315edd02899ada327cb90ccae22 (patch)
tree2c47c5977fbf036fc1b446b2884d61114a1aa99c
parent4d861a2a4b10cf27d993353864a27b0da478e3ee (diff)
downloadchromium_src-85ee5bb142b5a315edd02899ada327cb90ccae22.zip
chromium_src-85ee5bb142b5a315edd02899ada327cb90ccae22.tar.gz
chromium_src-85ee5bb142b5a315edd02899ada327cb90ccae22.tar.bz2
Add an accessible name for the Chrome OS Launcher.
Previously the items in the launcher were accessible, but there was no context. BUG=none Review URL: https://chromiumcodereview.appspot.com/14940003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200884 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash_strings.grd3
-rw-r--r--ash/launcher/launcher_view.cc6
-rw-r--r--ash/launcher/launcher_view.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd
index 4d850cf..2ea0cf8 100644
--- a/ash/ash_strings.grd
+++ b/ash/ash_strings.grd
@@ -188,6 +188,9 @@ This file contains the strings for ash.
<message name="IDS_AURA_LAUNCHER_CONTEXT_MENU_ALIGN_RIGHT" desc="Title of the menu item in the context menu for aligning the launcher to the right of the screen">
Right
</message>
+ <message name="IDS_ASH_LAUNCHER_ACCESSIBLE_NAME" desc="The accessible name of the launcher.">
+ Launcher
+ </message>
<message name="IDS_AURA_SET_DESKTOP_WALLPAPER" desc="The label used for change wallpaper in context menu">
Set wallpaper...
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index f24a1f5..ead08792 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -30,6 +30,7 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/base/resource/resource_bundle.h"
@@ -1191,6 +1192,11 @@ views::FocusTraversable* LauncherView::GetPaneFocusTraversable() {
return this;
}
+void LauncherView::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_TOOLBAR;
+ state->name = l10n_util::GetStringUTF16(IDS_ASH_LAUNCHER_ACCESSIBLE_NAME);
+}
+
void LauncherView::OnGestureEvent(ui::GestureEvent* event) {
if (gesture_handler_.ProcessGestureEvent(*event))
event->StopPropagation();
diff --git a/ash/launcher/launcher_view.h b/ash/launcher/launcher_view.h
index 26bd8c5..e91f07b 100644
--- a/ash/launcher/launcher_view.h
+++ b/ash/launcher/launcher_view.h
@@ -201,6 +201,7 @@ class ASH_EXPORT LauncherView : public views::View,
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
virtual FocusTraversable* GetPaneFocusTraversable() OVERRIDE;
+ virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
// Overridden from ui::EventHandler:
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;