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 <objidl.h> | 7 #include <objidl.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
10 | 10 |
11 #include "ui/base/dragdrop/os_exchange_data.h" | 11 #include "ui/base/dragdrop/os_exchange_data.h" |
12 #include "gfx/canvas_skia.h" | |
13 #include "gfx/gdi_util.h" | |
14 #include "gfx/skbitmap_operations.h" | |
15 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
16 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 13 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
| 14 #include "ui/gfx/canvas_skia.h" |
| 15 #include "ui/gfx/gdi_util.h" |
| 16 #include "ui/gfx/skbitmap_operations.h" |
17 | 17 |
18 using ui::OSExchangeData; | 18 using ui::OSExchangeData; |
19 using ui::OSExchangeDataProviderWin; | 19 using ui::OSExchangeDataProviderWin; |
20 | 20 |
21 namespace drag_utils { | 21 namespace drag_utils { |
22 | 22 |
23 static void SetDragImageOnDataObject(HBITMAP hbitmap, | 23 static void SetDragImageOnDataObject(HBITMAP hbitmap, |
24 const gfx::Size& size, | 24 const gfx::Size& size, |
25 const gfx::Point& cursor_offset, | 25 const gfx::Point& cursor_offset, |
26 IDataObject* data_object) { | 26 IDataObject* data_object) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. | 65 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. |
66 HBITMAP bitmap = CreateHBITMAPFromSkBitmap( | 66 HBITMAP bitmap = CreateHBITMAPFromSkBitmap( |
67 SkBitmapOperations::UnPreMultiply(sk_bitmap)); | 67 SkBitmapOperations::UnPreMultiply(sk_bitmap)); |
68 | 68 |
69 // Attach 'bitmap' to the data_object. | 69 // Attach 'bitmap' to the data_object. |
70 SetDragImageOnDataObject(bitmap, size, cursor_offset, | 70 SetDragImageOnDataObject(bitmap, size, cursor_offset, |
71 OSExchangeDataProviderWin::GetIDataObject(*data_object)); | 71 OSExchangeDataProviderWin::GetIDataObject(*data_object)); |
72 } | 72 } |
73 | 73 |
74 } // namespace drag_utils | 74 } // namespace drag_utils |
OLD | NEW |