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

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

Issue 2850683002: Remove ScopedComPtr::ReceiveVoid and Add ScopedComPtrRef (Closed)
Patch Set: Add Explicit Created 3 years, 7 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
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | ui/gl/gl_angle_util_win.cc » ('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/os_exchange_data_provider_win.h" 5 #include "ui/base/dragdrop/os_exchange_data_provider_win.h"
6 6
7 #include <objbase.h>
7 #include <objidl.h> 8 #include <objidl.h>
8 #include <shlobj.h> 9 #include <shlobj.h>
9 #include <shobjidl.h> 10 #include <shobjidl.h>
10 #include <stdint.h> 11 #include <stdint.h>
11 12
12 #include <algorithm> 13 #include <algorithm>
13 #include <iterator> 14 #include <iterator>
14 15
15 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
16 #include "base/i18n/file_util_icu.h" 17 #include "base/i18n/file_util_icu.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 CreateDIBSection(screen_dc, reinterpret_cast<BITMAPINFO*>(&header), 577 CreateDIBSection(screen_dc, reinterpret_cast<BITMAPINFO*>(&header),
577 DIB_RGB_COLORS, &bits, NULL, 0); 578 DIB_RGB_COLORS, &bits, NULL, 0);
578 } 579 }
579 if (!hbitmap) 580 if (!hbitmap)
580 return; 581 return;
581 582
582 memcpy(bits, unpremul_bitmap.getPixels(), height * rowbytes); 583 memcpy(bits, unpremul_bitmap.getPixels(), height * rowbytes);
583 584
584 base::win::ScopedComPtr<IDragSourceHelper> helper; 585 base::win::ScopedComPtr<IDragSourceHelper> helper;
585 HRESULT rv = CoCreateInstance(CLSID_DragDropHelper, 0, CLSCTX_INPROC_SERVER, 586 HRESULT rv = CoCreateInstance(CLSID_DragDropHelper, 0, CLSCTX_INPROC_SERVER,
586 IID_IDragSourceHelper, helper.ReceiveVoid()); 587 IID_PPV_ARGS(&helper));
587 if (!SUCCEEDED(rv)) 588 if (!SUCCEEDED(rv))
588 return; 589 return;
589 590
590 // InitializeFromBitmap() takes ownership of |hbitmap|. 591 // InitializeFromBitmap() takes ownership of |hbitmap|.
591 SHDRAGIMAGE sdi; 592 SHDRAGIMAGE sdi;
592 sdi.sizeDragImage.cx = width; 593 sdi.sizeDragImage.cx = width;
593 sdi.sizeDragImage.cy = height; 594 sdi.sizeDragImage.cy = height;
594 sdi.crColorKey = 0xFFFFFFFF; 595 sdi.crColorKey = 0xFFFFFFFF;
595 sdi.hbmpDragImage = hbitmap; 596 sdi.hbmpDragImage = hbitmap;
596 sdi.ptOffset = gfx::PointAtOffsetFromOrigin(cursor_offset).ToPOINT(); 597 sdi.ptOffset = gfx::PointAtOffsetFromOrigin(cursor_offset).ToPOINT();
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 std::min(file_name.size(), static_cast<size_t>(MAX_PATH - 1u))); 1119 std::min(file_name.size(), static_cast<size_t>(MAX_PATH - 1u)));
1119 1120
1120 STGMEDIUM* storage = new STGMEDIUM; 1121 STGMEDIUM* storage = new STGMEDIUM;
1121 storage->tymed = TYMED_HGLOBAL; 1122 storage->tymed = TYMED_HGLOBAL;
1122 storage->hGlobal = hdata; 1123 storage->hGlobal = hdata;
1123 storage->pUnkForRelease = NULL; 1124 storage->pUnkForRelease = NULL;
1124 return storage; 1125 return storage;
1125 } 1126 }
1126 1127
1127 } // namespace ui 1128 } // namespace ui
OLDNEW
« no previous file with comments | « remoting/host/audio_capturer_win.cc ('k') | ui/gl/gl_angle_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698