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

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 2894483002: Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/... (Closed)
Patch Set: Fix Header Include Location 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.cc ('k') | chrome/browser/speech/tts_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_win.cc
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index 3b6a0ba7c1ba678a7cbe85a1e380e62e9fe3a83c..06dbc42d025ac612636b61e19ce233ebdeec3f5f 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/shell_integration_win.h"
#include <windows.h>
+#include <objbase.h>
#include <shlwapi.h>
#include <shobjidl.h>
#include <propkey.h> // Needs to come after shobjidl.h.
@@ -782,8 +783,8 @@ int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe,
// Load the shortcut.
base::win::ScopedComPtr<IShellLink> shell_link;
base::win::ScopedComPtr<IPersistFile> persist_file;
- if (FAILED(shell_link.CreateInstance(CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER)) ||
+ if (FAILED(::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&shell_link))) ||
FAILED(shell_link.CopyTo(persist_file.GetAddressOf())) ||
FAILED(persist_file->Load(shortcut.value().c_str(), STGM_READ))) {
DLOG(WARNING) << "Failed loading shortcut at " << shortcut.value();
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.cc ('k') | chrome/browser/speech/tts_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698