Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: ui/app_list/views/apps_grid_view.cc

Issue 1003393002: After uninstall, remove last item in Launcher folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« ui/app_list/views/app_list_main_view.cc ('K') | « ui/app_list/views/apps_grid_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698