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 <objidl.h> | 7 #include <objidl.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // by premultiplied colors, so unpremultiply the bitmap. | 65 // by premultiplied colors, so unpremultiply the bitmap. |
66 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. | 66 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. |
67 HBITMAP bitmap = CreateHBITMAPFromSkBitmap( | 67 HBITMAP bitmap = CreateHBITMAPFromSkBitmap( |
68 SkBitmapOperations::UnPreMultiply(*image_skia.bitmap())); | 68 SkBitmapOperations::UnPreMultiply(*image_skia.bitmap())); |
69 if (bitmap) { | 69 if (bitmap) { |
70 // Attach 'bitmap' to the data_object. | 70 // Attach 'bitmap' to the data_object. |
71 SetDragImageOnDataObject(bitmap, size, cursor_offset, | 71 SetDragImageOnDataObject(bitmap, size, cursor_offset, |
72 ui::OSExchangeDataProviderWin::GetIDataObject(*data_object)); | 72 ui::OSExchangeDataProviderWin::GetIDataObject(*data_object)); |
73 } | 73 } |
74 | 74 |
75 #if defined(USE_AURA) | |
76 // TODO: the above code is used in non-Ash, while below is used in Ash. If we | 75 // TODO: the above code is used in non-Ash, while below is used in Ash. If we |
77 // could figure this context out then we wouldn't do unnecessary work. However | 76 // could figure this context out then we wouldn't do unnecessary work. However |
78 // as it stands getting this information in ui/base would be a layering | 77 // as it stands getting this information in ui/base would be a layering |
79 // violation. | 78 // violation. |
80 data_object->provider().SetDragImage(image_skia, cursor_offset); | 79 data_object->provider().SetDragImage(image_skia, cursor_offset); |
81 #endif | |
82 } | 80 } |
83 | 81 |
84 } // namespace drag_utils | 82 } // namespace drag_utils |
OLD | NEW |