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

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: Code review fix 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..fc6200fed80b819a188007822595752f116ea48a 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"
@@ -23,6 +24,7 @@
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
#include "ui/views/controls/menu/menu_runner.h"
+#include "ui/views/widget/widget.h"
sky 2012/04/20 15:33:26 Do you really need this include?
Zachary Kuznia 2012/04/23 05:59:23 Done.
namespace ash {
@@ -203,6 +205,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 +254,7 @@ void AppListItemView::SetSelected(bool selected) {
if (selected == selected_)
return;
+ RequestFocus();
selected_ = selected;
SchedulePaint();
}
@@ -360,6 +364,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