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 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 | 728 |
729 AppListItemView* AppsGridView::GetItemViewAt(int index) const { | 729 AppListItemView* AppsGridView::GetItemViewAt(int index) const { |
730 DCHECK(index >= 0 && index < view_model_.view_size()); | 730 DCHECK(index >= 0 && index < view_model_.view_size()); |
731 return static_cast<AppListItemView*>(view_model_.view_at(index)); | 731 return static_cast<AppListItemView*>(view_model_.view_at(index)); |
732 } | 732 } |
733 | 733 |
734 void AppsGridView::SetTopItemViewsVisible(bool visible) { | 734 void AppsGridView::SetTopItemViewsVisible(bool visible) { |
735 int top_item_count = std::min(static_cast<int>(kNumFolderTopItems), | 735 int top_item_count = std::min(static_cast<int>(kNumFolderTopItems), |
736 view_model_.view_size()); | 736 view_model_.view_size()); |
737 for (int i = 0; i < top_item_count; ++i) | 737 for (int i = 0; i < top_item_count; ++i) |
738 GetItemViewAt(i)->SetVisible(visible); | 738 GetItemViewAt(i)->icon()->SetVisible(visible); |
739 } | 739 } |
740 | 740 |
741 void AppsGridView::ScheduleShowHideAnimation(bool show) { | 741 void AppsGridView::ScheduleShowHideAnimation(bool show) { |
742 // Stop any previous animation. | 742 // Stop any previous animation. |
743 layer()->GetAnimator()->StopAnimating(); | 743 layer()->GetAnimator()->StopAnimating(); |
744 | 744 |
745 // Set initial state. | 745 // Set initial state. |
746 SetVisible(true); | 746 SetVisible(true); |
747 layer()->SetOpacity(show ? 0.0f : 1.0f); | 747 layer()->SetOpacity(show ? 0.0f : 1.0f); |
748 | 748 |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2162 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
2163 bool is_target_folder) { | 2163 bool is_target_folder) { |
2164 AppListItemView* target_view = | 2164 AppListItemView* target_view = |
2165 static_cast<AppListItemView*>( | 2165 static_cast<AppListItemView*>( |
2166 GetViewAtSlotOnCurrentPage(target_index.slot)); | 2166 GetViewAtSlotOnCurrentPage(target_index.slot)); |
2167 if (target_view) | 2167 if (target_view) |
2168 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2168 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
2169 } | 2169 } |
2170 | 2170 |
2171 } // namespace app_list | 2171 } // namespace app_list |
OLD | NEW |