Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2588)

Unified Diff: ash/app_list/app_list_item_view.cc

Issue 9985005: Add accessibility info to app list items and allow them to be focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra include Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/app_list/app_list_item_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_item_view.cc
diff --git a/ash/app_list/app_list_item_view.cc b/ash/app_list/app_list_item_view.cc
index c9e74922154ff86079305586f38d0294a68bb239..dc6d247adcafe303652358248062182fba6f9b3a 100644
--- a/ash/app_list/app_list_item_view.cc
+++ b/ash/app_list/app_list_item_view.cc
@@ -13,6 +13,7 @@
#include "base/synchronization/cancellation_flag.h"
#include "base/threading/worker_pool.h"
#include "base/utf_string_conversions.h"
+#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/animation/throb_animation.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
@@ -203,6 +204,7 @@ AppListItemView::AppListItemView(AppListModelView* list_model_view,
set_context_menu_controller(this);
set_request_focus_on_press(false);
+ set_focusable(true);
}
AppListItemView::~AppListItemView() {
@@ -251,6 +253,7 @@ void AppListItemView::SetSelected(bool selected) {
if (selected == selected_)
return;
+ RequestFocus();
selected_ = selected;
SchedulePaint();
}
@@ -360,6 +363,11 @@ void AppListItemView::OnPaint(gfx::Canvas* canvas) {
}
}
+void AppListItemView::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
+ state->name = UTF8ToUTF16(model_->title());
+}
+
void AppListItemView::ShowContextMenuForView(views::View* source,
const gfx::Point& point) {
ui::MenuModel* menu_model = model_->GetContextMenuModel();
« no previous file with comments | « ash/app_list/app_list_item_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698