OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/app_list/apps_grid_view.h" | 5 #include "ui/app_list/apps_grid_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/app_list_item_view.h" | 9 #include "ui/app_list/app_list_item_view.h" |
10 #include "ui/app_list/pagination_model.h" | 10 #include "ui/app_list/pagination_model.h" |
11 #include "ui/base/events/event.h" | 11 #include "ui/base/events/event.h" |
12 #include "ui/views/border.h" | 12 #include "ui/views/border.h" |
| 13 #include "ui/views/widget/widget.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 // Padding space in pixels for fixed layout. | 17 // Padding space in pixels for fixed layout. |
17 const int kLeftRightPadding = 20; | 18 const int kLeftRightPadding = 20; |
18 const int kTopPadding = 1; | 19 const int kTopPadding = 1; |
19 | 20 |
20 // Padding space in pixels between pages. | 21 // Padding space in pixels between pages. |
21 const int kPagePadding = 40; | 22 const int kPagePadding = 40; |
22 | 23 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 if (selected_item_index_ == index) | 289 if (selected_item_index_ == index) |
289 return; | 290 return; |
290 | 291 |
291 if (selected_item_index_ >= 0) | 292 if (selected_item_index_ >= 0) |
292 GetItemViewAtIndex(selected_item_index_)->SchedulePaint(); | 293 GetItemViewAtIndex(selected_item_index_)->SchedulePaint(); |
293 | 294 |
294 if (index < 0 || index >= child_count()) { | 295 if (index < 0 || index >= child_count()) { |
295 selected_item_index_ = -1; | 296 selected_item_index_ = -1; |
296 } else { | 297 } else { |
297 selected_item_index_ = index; | 298 selected_item_index_ = index; |
298 GetItemViewAtIndex(selected_item_index_)->SchedulePaint(); | 299 AppListItemView* selected_view = GetItemViewAtIndex(selected_item_index_); |
| 300 selected_view->SchedulePaint(); |
| 301 GetWidget()->NotifyAccessibilityEvent( |
| 302 selected_view, ui::AccessibilityTypes::EVENT_FOCUS, true); |
299 | 303 |
300 if (tiles_per_page()) { | 304 if (tiles_per_page()) { |
301 pagination_model_->SelectPage(selected_item_index_ / tiles_per_page(), | 305 pagination_model_->SelectPage(selected_item_index_ / tiles_per_page(), |
302 true /* animate */); | 306 true /* animate */); |
303 } | 307 } |
304 } | 308 } |
305 } | 309 } |
306 | 310 |
307 void AppsGridView::ListItemsAdded(size_t start, size_t count) { | 311 void AppsGridView::ListItemsAdded(size_t start, size_t count) { |
308 for (size_t i = start; i < start + count; ++i) | 312 for (size_t i = start; i < start + count; ++i) |
(...skipping 24 matching lines...) Expand all Loading... |
333 | 337 |
334 void AppsGridView::SelectedPageChanged(int old_selected, int new_selected) { | 338 void AppsGridView::SelectedPageChanged(int old_selected, int new_selected) { |
335 Layout(); | 339 Layout(); |
336 } | 340 } |
337 | 341 |
338 void AppsGridView::TransitionChanged() { | 342 void AppsGridView::TransitionChanged() { |
339 Layout(); | 343 Layout(); |
340 } | 344 } |
341 | 345 |
342 } // namespace app_list | 346 } // namespace app_list |
OLD | NEW |