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

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

Issue 265723003: Fix app list drag view being hidden on reparent when synchronous drag is setting up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_list_win_stuck_icons_real
Patch Set: address comments Created 6 years, 8 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 | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/apps_grid_view_folder_delegate.h » ('j') | 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 d3857553c2bdc1aa6fe2da271c795393a5a0f30f..a9116d15b21fbc42373927a39466c0a9790acd15 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -217,6 +217,8 @@ class SynchronousDrag : public ui::DragSourceWin {
shortcut_path_ = shortcut_path;
}
+ bool running() { return running_; }
+
bool CanRun() {
return has_shortcut_path_ && !running_;
}
@@ -491,10 +493,20 @@ void AppsGridView::StartSettingUpSynchronousDrag() {
bool AppsGridView::RunSynchronousDrag() {
#if defined(OS_WIN)
- if (synchronous_drag_ && synchronous_drag_->CanRun()) {
+ if (!synchronous_drag_)
+ return false;
+
+ if (synchronous_drag_->CanRun()) {
+ if (IsDraggingForReparentInHiddenGridView())
+ folder_delegate_->SetRootLevelDragViewVisible(false);
synchronous_drag_->Run();
synchronous_drag_ = NULL;
return true;
+ } else if (!synchronous_drag_->running()) {
tapted 2014/05/02 01:52:47 nit: I think the condition is redundant (i.e. can
calamity 2014/05/02 04:28:38 Ah, true.
+ // The OS drag is not ready yet. If the root grid has a drag view because
+ // a reparent has started, ensure it is visible.
+ if (IsDraggingForReparentInHiddenGridView())
+ folder_delegate_->SetRootLevelDragViewVisible(true);
}
#endif
return false;
@@ -766,6 +778,11 @@ void AppsGridView::ClearDragState(bool cancel_reparent) {
dragging_for_reparent_item_ = false;
}
+void AppsGridView::SetDragViewVisible(bool visible) {
+ DCHECK(drag_view_);
+ SetViewHidden(drag_view_, !visible, true);
+}
+
void AppsGridView::SetDragAndDropHostOfCurrentAppList(
ApplicationDragAndDropHost* drag_and_drop_host) {
drag_and_drop_host_ = drag_and_drop_host;
« no previous file with comments | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/apps_grid_view_folder_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698