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

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

Issue 806883004: Revert "Fix crash after Launcher drag/drop" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | ui/app_list/views/apps_grid_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } else if (IsValidIndex(reorder_drop_target_)) { 701 } else if (IsValidIndex(reorder_drop_target_)) {
702 MoveItemInModel(drag_view_, reorder_drop_target_); 702 MoveItemInModel(drag_view_, reorder_drop_target_);
703 } 703 }
704 } 704 }
705 } 705 }
706 706
707 if (drag_and_drop_host_) { 707 if (drag_and_drop_host_) {
708 // If we had a drag and drop proxy icon, we delete it and make the real 708 // If we had a drag and drop proxy icon, we delete it and make the real
709 // item visible again. 709 // item visible again.
710 drag_and_drop_host_->DestroyDragIconProxy(); 710 drag_and_drop_host_->DestroyDragIconProxy();
711 // Issue 439055: MoveItemToFolder() can sometimes delete drag_view_ 711 if (landed_in_drag_and_drop_host) {
712 if (drag_view_) { 712 // Move the item directly to the target location, avoiding the "zip back"
713 if (landed_in_drag_and_drop_host) { 713 // animation if the user was pinning it to the shelf.
714 // Move the item directly to the target location, avoiding the 714 int i = reorder_drop_target_.slot;
715 // "zip back" animation if the user was pinning it to the shelf. 715 gfx::Rect bounds = view_model_.ideal_bounds(i);
716 int i = reorder_drop_target_.slot; 716 drag_view_->SetBoundsRect(bounds);
717 gfx::Rect bounds = view_model_.ideal_bounds(i);
718 drag_view_->SetBoundsRect(bounds);
719 }
720 // Fade in slowly if it landed in the shelf.
721 SetViewHidden(drag_view_, false /* show */,
722 !landed_in_drag_and_drop_host /* animate */);
723 } 717 }
718 // Fade in slowly if it landed in the shelf.
719 SetViewHidden(drag_view_,
720 false /* show */,
721 !landed_in_drag_and_drop_host /* animate */);
724 } 722 }
725 723
726 // The drag can be ended after the synchronous drag is created but before it 724 // The drag can be ended after the synchronous drag is created but before it
727 // is Run(). 725 // is Run().
728 CleanUpSynchronousDrag(); 726 CleanUpSynchronousDrag();
729 727
730 SetAsFolderDroppingTarget(folder_drop_target_, false); 728 SetAsFolderDroppingTarget(folder_drop_target_, false);
731 ClearDragState(); 729 ClearDragState();
732 AnimateToIdealBounds(); 730 AnimateToIdealBounds();
733 731
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 2168
2171 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index, 2169 void AppsGridView::SetAsFolderDroppingTarget(const Index& target_index,
2172 bool is_target_folder) { 2170 bool is_target_folder) {
2173 AppListItemView* target_view = 2171 AppListItemView* target_view =
2174 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot); 2172 GetViewDisplayedAtSlotOnCurrentPage(target_index.slot);
2175 if (target_view) 2173 if (target_view)
2176 target_view->SetAsAttemptedFolderTarget(is_target_folder); 2174 target_view->SetAsAttemptedFolderTarget(is_target_folder);
2177 } 2175 }
2178 2176
2179 } // namespace app_list 2177 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/apps_grid_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698