| 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 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 bounds_animator_.AnimateViewTo(drag_view_, drag_view_->bounds()); | 1923 bounds_animator_.AnimateViewTo(drag_view_, drag_view_->bounds()); |
| 1924 bounds_animator_.SetAnimationDelegate( | 1924 bounds_animator_.SetAnimationDelegate( |
| 1925 drag_view_, | 1925 drag_view_, |
| 1926 scoped_ptr<gfx::AnimationDelegate>( | 1926 scoped_ptr<gfx::AnimationDelegate>( |
| 1927 new ItemRemoveAnimationDelegate(drag_view_))); | 1927 new ItemRemoveAnimationDelegate(drag_view_))); |
| 1928 UpdatePaging(); | 1928 UpdatePaging(); |
| 1929 | 1929 |
| 1930 return true; | 1930 return true; |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 // After moving the re-parenting item out of the folder, if there is only 1 item | 1933 // After uninstalling or moving the re-parenting item out of the folder, if |
| 1934 // left, remove the last item out of the folder, delete the folder and insert it | 1934 // there is only 1 item left, remove the last item out of the folder, delete the |
| 1935 // to the data model at the same position. Make the same change to view_model_ | 1935 // folder and insert it to the data model at the same position. Make the same |
| 1936 // accordingly. | 1936 // change to view_model_ accordingly. |
| 1937 void AppsGridView::RemoveLastItemFromReparentItemFolderIfNecessary( | 1937 void AppsGridView::RemoveLastItemFromReparentItemFolderIfNecessary( |
| 1938 const std::string& source_folder_id) { | 1938 const std::string& source_folder_id) { |
| 1939 AppListFolderItem* source_folder = | 1939 AppListFolderItem* source_folder = |
| 1940 static_cast<AppListFolderItem*>(item_list_->FindItem(source_folder_id)); | 1940 static_cast<AppListFolderItem*>(item_list_->FindItem(source_folder_id)); |
| 1941 if (!source_folder || source_folder->ChildItemCount() != 1u) | 1941 if (!source_folder || source_folder->ChildItemCount() != 1u) |
| 1942 return; | 1942 return; |
| 1943 | 1943 |
| 1944 // Delete view associated with the folder item to be removed. | 1944 // Delete view associated with the folder item to be removed. |
| 1945 DeleteItemViewAtIndex( | 1945 DeleteItemViewAtIndex( |
| 1946 view_model_.GetIndexOfView(activated_folder_item_view())); | 1946 view_model_.GetIndexOfView(activated_folder_item_view())); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2177 | 2177 |
| 2178 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, | 2178 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, |
| 2179 bool is_target_folder) { | 2179 bool is_target_folder) { |
| 2180 AppListItemView* target_view = | 2180 AppListItemView* target_view = |
| 2181 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); | 2181 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); |
| 2182 if (target_view) | 2182 if (target_view) |
| 2183 target_view->SetAsAttemptedFolderTarget(is_target_folder); | 2183 target_view->SetAsAttemptedFolderTarget(is_target_folder); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 } // namespace app_list | 2186 } // namespace app_list |
| OLD | NEW |