OLD | NEW |
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 26 matching lines...) Expand all Loading... |
37 #include "ui/native_theme/native_theme.h" | 37 #include "ui/native_theme/native_theme.h" |
38 #include "ui/views/accessibility/native_view_accessibility.h" | 38 #include "ui/views/accessibility/native_view_accessibility.h" |
39 #include "ui/views/background.h" | 39 #include "ui/views/background.h" |
40 #include "ui/views/border.h" | 40 #include "ui/views/border.h" |
41 #include "ui/views/context_menu_controller.h" | 41 #include "ui/views/context_menu_controller.h" |
42 #include "ui/views/drag_controller.h" | 42 #include "ui/views/drag_controller.h" |
43 #include "ui/views/focus/view_storage.h" | 43 #include "ui/views/focus/view_storage.h" |
44 #include "ui/views/layout/layout_manager.h" | 44 #include "ui/views/layout/layout_manager.h" |
45 #include "ui/views/rect_based_targeting_utils.h" | 45 #include "ui/views/rect_based_targeting_utils.h" |
46 #include "ui/views/views_delegate.h" | 46 #include "ui/views/views_delegate.h" |
47 #include "ui/views/widget/native_widget_private.h" | 47 //#include "ui/views/widget/native_widget_private.h" |
48 #include "ui/views/widget/root_view.h" | 48 #include "ui/views/widget/root_view.h" |
49 #include "ui/views/widget/tooltip_manager.h" | 49 #include "ui/views/widget/tooltip_manager.h" |
50 #include "ui/views/widget/widget.h" | 50 #include "ui/views/widget/widget.h" |
51 | 51 |
52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
53 #include "base/win/scoped_gdi_object.h" | 53 #include "base/win/scoped_gdi_object.h" |
54 #endif | 54 #endif |
55 | 55 |
56 namespace { | 56 namespace { |
57 | 57 |
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 Widget* widget = GetWidget(); | 2333 Widget* widget = GetWidget(); |
2334 // We should only start a drag from an event, implying we have a widget. | 2334 // We should only start a drag from an event, implying we have a widget. |
2335 DCHECK(widget); | 2335 DCHECK(widget); |
2336 | 2336 |
2337 // Don't attempt to start a drag while in the process of dragging. This is | 2337 // Don't attempt to start a drag while in the process of dragging. This is |
2338 // especially important on X where we can get multiple mouse move events when | 2338 // especially important on X where we can get multiple mouse move events when |
2339 // we start the drag. | 2339 // we start the drag. |
2340 if (widget->dragged_view()) | 2340 if (widget->dragged_view()) |
2341 return false; | 2341 return false; |
2342 | 2342 |
| 2343 #ifdef FIXME |
2343 OSExchangeData data; | 2344 OSExchangeData data; |
2344 WriteDragData(press_pt, &data); | 2345 WriteDragData(press_pt, &data); |
2345 | 2346 |
2346 // Message the RootView to do the drag and drop. That way if we're removed | 2347 // Message the RootView to do the drag and drop. That way if we're removed |
2347 // the RootView can detect it and avoid calling us back. | 2348 // the RootView can detect it and avoid calling us back. |
2348 gfx::Point widget_location(event.location()); | 2349 gfx::Point widget_location(event.location()); |
2349 ConvertPointToWidget(this, &widget_location); | 2350 ConvertPointToWidget(this, &widget_location); |
2350 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2351 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2351 // WARNING: we may have been deleted. | 2352 // WARNING: we may have been deleted. |
2352 return true; | 2353 return true; |
| 2354 #else |
| 2355 return false; |
| 2356 #endif |
2353 } | 2357 } |
2354 | 2358 |
2355 } // namespace views | 2359 } // namespace views |
OLD | NEW |