Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: ui/base/dragdrop/drag_utils_win.cc

Issue 11787005: Get drag and drop working on Win Ash. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/dragdrop/drag_utils_aura.cc ('k') | ui/base/dragdrop/os_exchange_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 DCHECK(data_object && !size.IsEmpty()); 61 DCHECK(data_object && !size.IsEmpty());
62 // InitializeFromBitmap() doesn't expect an alpha channel and is confused 62 // InitializeFromBitmap() doesn't expect an alpha channel and is confused
63 // by premultiplied colors, so unpremultiply the bitmap. 63 // by premultiplied colors, so unpremultiply the bitmap.
64 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. 64 // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap.
65 HBITMAP bitmap = CreateHBITMAPFromSkBitmap( 65 HBITMAP bitmap = CreateHBITMAPFromSkBitmap(
66 SkBitmapOperations::UnPreMultiply(*image_skia.bitmap())); 66 SkBitmapOperations::UnPreMultiply(*image_skia.bitmap()));
67 67
68 // Attach 'bitmap' to the data_object. 68 // Attach 'bitmap' to the data_object.
69 SetDragImageOnDataObject(bitmap, size, cursor_offset, 69 SetDragImageOnDataObject(bitmap, size, cursor_offset,
70 ui::OSExchangeDataProviderWin::GetIDataObject(*data_object)); 70 ui::OSExchangeDataProviderWin::GetIDataObject(*data_object));
71
72 // TODO: the above code is used in non-Ash, while below is used in Ash. If we
73 // could figure this context out then we wouldn't do unnecessary work. However
74 // as it stands getting this information in ui/base would be a layering
75 // violation.
jam 2013/01/04 22:23:02 Basically this code block is doing thw ork for bot
76 data_object->provider().SetDragImage(image_skia, cursor_offset);
71 } 77 }
72 78
73 } // namespace drag_utils 79 } // namespace drag_utils
OLDNEW
« no previous file with comments | « ui/base/dragdrop/drag_utils_aura.cc ('k') | ui/base/dragdrop/os_exchange_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698