| 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/views/apps_grid_view.h" | 5 #include "ui/app_list/views/apps_grid_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/app_list/apps_grid_view_delegate.h" | 9 #include "ui/app_list/apps_grid_view_delegate.h" |
| 10 #include "ui/app_list/pagination_model.h" | 10 #include "ui/app_list/pagination_model.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 views::View* new_selection = GetViewAtIndex(index); | 399 views::View* new_selection = GetViewAtIndex(index); |
| 400 if (!new_selection) | 400 if (!new_selection) |
| 401 return; // Keep current selection. | 401 return; // Keep current selection. |
| 402 | 402 |
| 403 if (selected_view_) | 403 if (selected_view_) |
| 404 selected_view_->SchedulePaint(); | 404 selected_view_->SchedulePaint(); |
| 405 | 405 |
| 406 EnsureViewVisible(new_selection); | 406 EnsureViewVisible(new_selection); |
| 407 selected_view_ = new_selection; | 407 selected_view_ = new_selection; |
| 408 selected_view_->SchedulePaint(); | 408 selected_view_->SchedulePaint(); |
| 409 if (GetWidget()) { | 409 selected_view_->NotifyAccessibilityEvent( |
| 410 GetWidget()->NotifyAccessibilityEvent( | 410 ui::AccessibilityTypes::EVENT_FOCUS, true); |
| 411 selected_view_, ui::AccessibilityTypes::EVENT_FOCUS, true); | |
| 412 } | |
| 413 } | 411 } |
| 414 | 412 |
| 415 bool AppsGridView::IsValidIndex(const Index& index) const { | 413 bool AppsGridView::IsValidIndex(const Index& index) const { |
| 416 return index.page >= 0 && index.page < pagination_model_->total_pages() && | 414 return index.page >= 0 && index.page < pagination_model_->total_pages() && |
| 417 index.slot >= 0 && index.slot < tiles_per_page() && | 415 index.slot >= 0 && index.slot < tiles_per_page() && |
| 418 index.page * tiles_per_page() + index.slot < view_model_.view_size(); | 416 index.page * tiles_per_page() + index.slot < view_model_.view_size(); |
| 419 } | 417 } |
| 420 | 418 |
| 421 AppsGridView::Index AppsGridView::GetIndexOfView( | 419 AppsGridView::Index AppsGridView::GetIndexOfView( |
| 422 const views::View* view) const { | 420 const views::View* view) const { |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 Layout(); | 799 Layout(); |
| 802 } | 800 } |
| 803 | 801 |
| 804 void AppsGridView::OnAppListModelStatusChanged() { | 802 void AppsGridView::OnAppListModelStatusChanged() { |
| 805 UpdatePulsingBlockViews(); | 803 UpdatePulsingBlockViews(); |
| 806 Layout(); | 804 Layout(); |
| 807 SchedulePaint(); | 805 SchedulePaint(); |
| 808 } | 806 } |
| 809 | 807 |
| 810 } // namespace app_list | 808 } // namespace app_list |
| OLD | NEW |