| 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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 target_slot = last_item_slot; | 1160 target_slot = last_item_slot; |
| 1161 } | 1161 } |
| 1162 } | 1162 } |
| 1163 | 1163 |
| 1164 int target_page = std::min(pagination_model_.total_pages() - 1, | 1164 int target_page = std::min(pagination_model_.total_pages() - 1, |
| 1165 std::max(selected.page + page_delta, 0)); | 1165 std::max(selected.page + page_delta, 0)); |
| 1166 SetSelectedItemByIndex(Index(target_page, target_slot)); | 1166 SetSelectedItemByIndex(Index(target_page, target_slot)); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void AppsGridView::CalculateIdealBounds() { | 1169 void AppsGridView::CalculateIdealBounds() { |
| 1170 // TODO(calamity): This fixes http://crbug.com/422604 on ChromeOS but it's | 1170 // TODO(mgiuca): This is a work-around for http://crbug.com/422604. See |
| 1171 // unclear why. This should be investigated to fix the issue on Linux Ash. | 1171 // comment in ContentsView::Layout for details. This should be removed once |
| 1172 // http://crbug.com/446407 is resolved. |
| 1172 if (GetContentsBounds().IsEmpty()) | 1173 if (GetContentsBounds().IsEmpty()) |
| 1173 return; | 1174 return; |
| 1174 | 1175 |
| 1175 gfx::Size grid_size = GetTileGridSize(); | 1176 gfx::Size grid_size = GetTileGridSize(); |
| 1176 | 1177 |
| 1177 // Page size including padding pixels. A tile.x + page_width means the same | 1178 // Page size including padding pixels. A tile.x + page_width means the same |
| 1178 // tile slot in the next page; similarly for tile.y + page_height. | 1179 // tile slot in the next page; similarly for tile.y + page_height. |
| 1179 const int page_width = grid_size.width() + kPagePadding; | 1180 const int page_width = grid_size.width() + kPagePadding; |
| 1180 const int page_height = grid_size.height() + kPagePadding; | 1181 const int page_height = grid_size.height() + kPagePadding; |
| 1181 | 1182 |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 | 2171 |
| 2171 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2172 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
| 2172 bool is_target_folder) { | 2173 bool is_target_folder) { |
| 2173 AppListItemView* target_view = | 2174 AppListItemView* target_view = |
| 2174 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); | 2175 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); |
| 2175 if (target_view) | 2176 if (target_view) |
| 2176 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2177 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
| 2177 } | 2178 } |
| 2178 | 2179 |
| 2179 } // namespace app_list | 2180 } // namespace app_list |
| OLD | NEW |