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

Unified Diff: ui/app_list/views/apps_grid_view.cc

Issue 221903007: Check if the drag state is still valid when folder reparent folder timer fires. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/apps_grid_view.cc
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 516223a94afce0400ba9a0b518f46c2aec8c113a..40269855c10adf1d07caaed3499d180288034fdb 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -89,7 +89,7 @@ const int kFolderDroppingDelay = 150;
const int kReorderDelay = 120;
// Delays in milliseconds to show folder item reparent UI.
-const int kFolderItemReparentDealy = 50;
+const int kFolderItemReparentDelay = 50;
// Radius of the circle, in which if entered, show folder dropping preview
// UI.
@@ -1287,7 +1287,7 @@ void AppsGridView::OnReorderTimer() {
void AppsGridView::OnFolderItemReparentTimer() {
DCHECK(folder_delegate_);
- if (drag_out_of_folder_container_) {
+ if (drag_out_of_folder_container_ && drag_view_) {
folder_delegate_->ReparentItem(drag_view_, last_drag_point_);
// Set the flag in the folder's grid view.
@@ -1327,9 +1327,11 @@ void AppsGridView::UpdateDragStateInsideFolder(Pointer pointer,
folder_delegate_->IsPointOutsideOfFolderBoundary(pt);
if (is_item_dragged_out_of_folder) {
if (!drag_out_of_folder_container_) {
- folder_item_reparent_timer_.Start(FROM_HERE,
- base::TimeDelta::FromMilliseconds(kFolderItemReparentDealy),
- this, &AppsGridView::OnFolderItemReparentTimer);
+ folder_item_reparent_timer_.Start(
+ FROM_HERE,
+ base::TimeDelta::FromMilliseconds(kFolderItemReparentDelay),
+ this,
+ &AppsGridView::OnFolderItemReparentTimer);
drag_out_of_folder_container_ = true;
}
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698