| 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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 } | 1986 } |
| 1987 | 1987 |
| 1988 void AppsGridView::OnImplicitAnimationsCompleted() { | 1988 void AppsGridView::OnImplicitAnimationsCompleted() { |
| 1989 if (layer()->opacity() == 0.0f) | 1989 if (layer()->opacity() == 0.0f) |
| 1990 SetVisible(false); | 1990 SetVisible(false); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 bool AppsGridView::EnableFolderDragDropUI() { | 1993 bool AppsGridView::EnableFolderDragDropUI() { |
| 1994 // Enable drag and drop folder UI only if it is at the app list root level | 1994 // Enable drag and drop folder UI only if it is at the app list root level |
| 1995 // and the switch is on and the target folder can still accept new items. | 1995 // and the switch is on and the target folder can still accept new items. |
| 1996 return switches::IsFolderUIEnabled() && !folder_delegate_ && | 1996 return model_->folders_enabled() && !folder_delegate_ && |
| 1997 CanDropIntoTarget(drop_target_); | 1997 CanDropIntoTarget(drop_target_); |
| 1998 } | 1998 } |
| 1999 | 1999 |
| 2000 bool AppsGridView::CanDropIntoTarget(const Index& drop_target) { | 2000 bool AppsGridView::CanDropIntoTarget(const Index& drop_target) { |
| 2001 views::View* target_view = GetViewAtSlotOnCurrentPage(drop_target.slot); | 2001 views::View* target_view = GetViewAtSlotOnCurrentPage(drop_target.slot); |
| 2002 if (!target_view) | 2002 if (!target_view) |
| 2003 return true; | 2003 return true; |
| 2004 | 2004 |
| 2005 AppListItem* target_item = | 2005 AppListItem* target_item = |
| 2006 static_cast<AppListItemView*>(target_view)->item(); | 2006 static_cast<AppListItemView*>(target_view)->item(); |
| 2007 // Items can be dropped into non-folders (which have no children) or folders | 2007 // Items can be dropped into non-folders (which have no children) or folders |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2170 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2170 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
| 2171 bool is_target_folder) { | 2171 bool is_target_folder) { |
| 2172 AppListItemView* target_view = | 2172 AppListItemView* target_view = |
| 2173 static_cast<AppListItemView*>( | 2173 static_cast<AppListItemView*>( |
| 2174 GetViewAtSlotOnCurrentPage(target_index.slot)); | 2174 GetViewAtSlotOnCurrentPage(target_index.slot)); |
| 2175 if (target_view) | 2175 if (target_view) |
| 2176 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2176 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 } // namespace app_list | 2179 } // namespace app_list |
| OLD | NEW |