| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/base/dragdrop/os_exchange_data.h" |
| 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/gfx/geometry/size.h" |
| 11 #include "ui/gfx/geometry/vector2d.h" |
| 12 #include "ui/gfx/image/image_skia.h" |
| 8 | 13 |
| 9 namespace drag_utils { | 14 namespace drag_utils { |
| 10 | 15 |
| 11 void SetDragImageOnDataObject(const gfx::Canvas& canvas, | 16 void SetDragImageOnDataObject(const gfx::Canvas& canvas, |
| 12 const gfx::Vector2d& cursor_offset, | 17 const gfx::Vector2d& cursor_offset, |
| 13 ui::OSExchangeData* data_object) { | 18 ui::OSExchangeData* data_object) { |
| 14 NOTIMPLEMENTED(); | 19 gfx::ImageSkia image = gfx::ImageSkia(canvas.ExtractImageRep()); |
| 20 SetDragImageOnDataObject(image, cursor_offset, data_object); |
| 15 } | 21 } |
| 16 | 22 |
| 17 void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, | 23 void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, |
| 18 const gfx::Vector2d& cursor_offset, | 24 const gfx::Vector2d& cursor_offset, |
| 19 ui::OSExchangeData* data_object) { | 25 ui::OSExchangeData* data_object) { |
| 20 NOTIMPLEMENTED(); | 26 data_object->provider().SetDragImage(image_skia); |
| 21 } | 27 } |
| 22 | 28 |
| 23 } // namespace drag_utils | 29 } // namespace drag_utils |
| OLD | NEW |