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

Side by Side Diff: ui/views/view.cc

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot to add the test Created 4 years, 7 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 2405
2406 // Don't attempt to start a drag while in the process of dragging. This is 2406 // Don't attempt to start a drag while in the process of dragging. This is
2407 // especially important on X where we can get multiple mouse move events when 2407 // especially important on X where we can get multiple mouse move events when
2408 // we start the drag. 2408 // we start the drag.
2409 if (widget->dragged_view()) 2409 if (widget->dragged_view())
2410 return false; 2410 return false;
2411 2411
2412 OSExchangeData data; 2412 OSExchangeData data;
2413 WriteDragData(press_pt, &data); 2413 WriteDragData(press_pt, &data);
2414 2414
2415 // The Native Event is required for OSX's native drag and drop. As such, it's
2416 // necessary to pass down the Event object.
2417 #if defined(OS_MACOSX)
2418 data.provider().SetEvent(event);
tapted 2016/05/24 08:06:02 So I'm still unsure about this. I found one place
spqchan 2016/05/26 01:56:55 Ahh, that's a really good point! I made a change s
2419 #endif
2420
2415 // Message the RootView to do the drag and drop. That way if we're removed 2421 // Message the RootView to do the drag and drop. That way if we're removed
2416 // the RootView can detect it and avoid calling us back. 2422 // the RootView can detect it and avoid calling us back.
2417 gfx::Point widget_location(event.location()); 2423 gfx::Point widget_location(event.location());
2418 ConvertPointToWidget(this, &widget_location); 2424 ConvertPointToWidget(this, &widget_location);
2419 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2425 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2420 // WARNING: we may have been deleted. 2426 // WARNING: we may have been deleted.
2421 return true; 2427 return true;
2422 } 2428 }
2423 2429
2424 } // namespace views 2430 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698