| 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 for (int i = start; i < end; i++) { | 834 for (int i = start; i < end; i++) { |
| 835 AppListItemView* v = static_cast<AppListItemView*>(view_model_.view_at(i)); | 835 AppListItemView* v = static_cast<AppListItemView*>(view_model_.view_at(i)); |
| 836 v->Prerender(); | 836 v->Prerender(); |
| 837 } | 837 } |
| 838 } | 838 } |
| 839 | 839 |
| 840 bool AppsGridView::IsAnimatingView(views::View* view) { | 840 bool AppsGridView::IsAnimatingView(views::View* view) { |
| 841 return bounds_animator_.IsAnimating(view); | 841 return bounds_animator_.IsAnimating(view); |
| 842 } | 842 } |
| 843 | 843 |
| 844 gfx::Size AppsGridView::GetPreferredSize() { | 844 gfx::Size AppsGridView::GetPreferredSize() const { |
| 845 const gfx::Insets insets(GetInsets()); | 845 const gfx::Insets insets(GetInsets()); |
| 846 const gfx::Size tile_size = gfx::Size(kPreferredTileWidth, | 846 const gfx::Size tile_size = gfx::Size(kPreferredTileWidth, |
| 847 kPreferredTileHeight); | 847 kPreferredTileHeight); |
| 848 const int page_switcher_height = | 848 const int page_switcher_height = |
| 849 page_switcher_view_->GetPreferredSize().height(); | 849 page_switcher_view_->GetPreferredSize().height(); |
| 850 return gfx::Size( | 850 return gfx::Size( |
| 851 tile_size.width() * cols_ + insets.width(), | 851 tile_size.width() * cols_ + insets.width(), |
| 852 tile_size.height() * rows_per_page_ + | 852 tile_size.height() * rows_per_page_ + |
| 853 page_switcher_height + insets.height()); | 853 page_switcher_height + insets.height()); |
| 854 } | 854 } |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2148 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
| 2149 bool is_target_folder) { | 2149 bool is_target_folder) { |
| 2150 AppListItemView* target_view = | 2150 AppListItemView* target_view = |
| 2151 static_cast<AppListItemView*>( | 2151 static_cast<AppListItemView*>( |
| 2152 GetViewAtSlotOnCurrentPage(target_index.slot)); | 2152 GetViewAtSlotOnCurrentPage(target_index.slot)); |
| 2153 if (target_view) | 2153 if (target_view) |
| 2154 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2154 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
| 2155 } | 2155 } |
| 2156 | 2156 |
| 2157 } // namespace app_list | 2157 } // namespace app_list |
| OLD | NEW |