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

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: 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 #if defined(OS_MACOSX)
2416 data.provider().SetNativeEvent(event.native_event());
tapted 2016/05/11 12:36:15 This looks funny, but might be justified. It would
spqchan 2016/05/23 21:26:21 I tried out the ideas you suggested but I think th
2417 #endif
2418
2415 // Message the RootView to do the drag and drop. That way if we're removed 2419 // 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. 2420 // the RootView can detect it and avoid calling us back.
2417 gfx::Point widget_location(event.location()); 2421 gfx::Point widget_location(event.location());
2418 ConvertPointToWidget(this, &widget_location); 2422 ConvertPointToWidget(this, &widget_location);
2419 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2423 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2420 // WARNING: we may have been deleted. 2424 // WARNING: we may have been deleted.
2421 return true; 2425 return true;
2422 } 2426 }
2423 2427
2424 } // namespace views 2428 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698