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 #include "ui/base/dragdrop/drag_utils.h" | 5 #include "ui/base/dragdrop/drag_utils.h" |
6 | 6 |
7 #include "ui/base/dragdrop/os_exchange_data.h" | 7 #include "ui/base/dragdrop/os_exchange_data.h" |
8 #include "ui/gfx/canvas.h" | |
9 #include "ui/gfx/image/image_skia.h" | |
10 | 8 |
11 namespace drag_utils { | 9 namespace drag_utils { |
12 | 10 |
13 void SetDragImageOnDataObject(const gfx::Canvas& canvas, | |
14 const gfx::Vector2d& cursor_offset, | |
15 ui::OSExchangeData* data_object) { | |
16 gfx::ImageSkia image = gfx::ImageSkia(canvas.ExtractImageRep()); | |
17 SetDragImageOnDataObject(image, cursor_offset, data_object); | |
18 } | |
19 | |
20 #if !defined(OS_WIN) | 11 #if !defined(OS_WIN) |
21 void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, | 12 void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, |
22 const gfx::Vector2d& cursor_offset, | 13 const gfx::Vector2d& cursor_offset, |
23 ui::OSExchangeData* data_object) { | 14 ui::OSExchangeData* data_object) { |
24 data_object->provider().SetDragImage(image_skia, cursor_offset); | 15 data_object->provider().SetDragImage(image_skia, cursor_offset); |
25 } | 16 } |
26 #endif | 17 #endif |
27 | 18 |
28 } // namespace drag_utils | 19 } // namespace drag_utils |
OLD | NEW |