| 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 for (int i = start; i < end; i++) | 880 for (int i = start; i < end; i++) |
| 881 GetItemViewAt(i)->Prerender(); | 881 GetItemViewAt(i)->Prerender(); |
| 882 } | 882 } |
| 883 | 883 |
| 884 bool AppsGridView::IsAnimatingView(AppListItemView* view) { | 884 bool AppsGridView::IsAnimatingView(AppListItemView* view) { |
| 885 return bounds_animator_.IsAnimating(view); | 885 return bounds_animator_.IsAnimating(view); |
| 886 } | 886 } |
| 887 | 887 |
| 888 gfx::Size AppsGridView::GetPreferredSize() const { | 888 gfx::Size AppsGridView::GetPreferredSize() const { |
| 889 const gfx::Insets insets(GetInsets()); | 889 const gfx::Insets insets(GetInsets()); |
| 890 int page_switcher_height = page_switcher_view_->GetPreferredSize().height(); | 890 // If we are in a folder, ignore the page switcher for height calculations. |
| 891 int page_switcher_height = |
| 892 folder_delegate_ ? 0 : page_switcher_view_->GetPreferredSize().height(); |
| 891 gfx::Size size = GetTileGridSize(); | 893 gfx::Size size = GetTileGridSize(); |
| 892 size.Enlarge(insets.width(), insets.height() + page_switcher_height); | 894 size.Enlarge(insets.width(), insets.height() + page_switcher_height); |
| 893 return size; | 895 return size; |
| 894 } | 896 } |
| 895 | 897 |
| 896 bool AppsGridView::GetDropFormats( | 898 bool AppsGridView::GetDropFormats( |
| 897 int* formats, | 899 int* formats, |
| 898 std::set<ui::Clipboard::FormatType>* format_types) { | 900 std::set<ui::Clipboard::FormatType>* format_types) { |
| 899 // TODO(koz): Only accept a specific drag type for app shortcuts. | 901 // TODO(koz): Only accept a specific drag type for app shortcuts. |
| 900 *formats = OSExchangeData::FILE_NAME; | 902 *formats = OSExchangeData::FILE_NAME; |
| (...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2182 | 2184 |
| 2183 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2185 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
| 2184 bool is_target_folder) { | 2186 bool is_target_folder) { |
| 2185 AppListItemView* target_view = | 2187 AppListItemView* target_view = |
| 2186 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); | 2188 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); |
| 2187 if (target_view) | 2189 if (target_view) |
| 2188 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2190 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
| 2189 } | 2191 } |
| 2190 | 2192 |
| 2191 } // namespace app_list | 2193 } // namespace app_list |
| OLD | NEW |