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