OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "views/drag_utils.h" | 5 #include "views/drag_utils.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "gfx/canvas.h" | |
11 #include "gfx/gtk_util.h" | |
12 #include "gfx/point.h" | |
13 #include "gfx/size.h" | |
14 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
15 #include "ui/base/dragdrop/os_exchange_data.h" | 11 #include "ui/base/dragdrop/os_exchange_data.h" |
16 #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h" | 12 #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h" |
| 13 #include "ui/gfx/canvas.h" |
| 14 #include "ui/gfx/gtk_util.h" |
| 15 #include "ui/gfx/point.h" |
| 16 #include "ui/gfx/size.h" |
17 | 17 |
18 using ui::OSExchangeData; | 18 using ui::OSExchangeData; |
19 using ui::OSExchangeDataProviderGtk; | 19 using ui::OSExchangeDataProviderGtk; |
20 | 20 |
21 namespace drag_utils { | 21 namespace drag_utils { |
22 | 22 |
23 void SetDragImageOnDataObject(const SkBitmap& bitmap, | 23 void SetDragImageOnDataObject(const SkBitmap& bitmap, |
24 const gfx::Size& size, | 24 const gfx::Size& size, |
25 const gfx::Point& cursor_offset, | 25 const gfx::Point& cursor_offset, |
26 OSExchangeData* data_object) { | 26 OSExchangeData* data_object) { |
(...skipping 13 matching lines...) Expand all Loading... |
40 gdk_pixbuf_copy_area(canvas_pixbuf, 0, 0, size.width(), size.height(), pixbuf, | 40 gdk_pixbuf_copy_area(canvas_pixbuf, 0, 0, size.width(), size.height(), pixbuf, |
41 0, 0); | 41 0, 0); |
42 g_object_unref(canvas_pixbuf); | 42 g_object_unref(canvas_pixbuf); |
43 | 43 |
44 // Set the drag data on to the provider. | 44 // Set the drag data on to the provider. |
45 provider.SetDragImage(pixbuf, cursor_offset); | 45 provider.SetDragImage(pixbuf, cursor_offset); |
46 g_object_unref(pixbuf); | 46 g_object_unref(pixbuf); |
47 } | 47 } |
48 | 48 |
49 } // namespace drag_utils | 49 } // namespace drag_utils |
OLD | NEW |