summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_update.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 20:04:07 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 20:04:07 +0000
commit530f43f302f1eef9d3530767015891f1db1f1272 (patch)
tree2006b20ca4022116b5d8c04784cec8802fb4d262 /chrome/browser/google_update.cc
parent0b9158f07ac7c5ed1dc1c166e4a1513d6fbbb9e9 (diff)
downloadchromium_src-530f43f302f1eef9d3530767015891f1db1f1272.zip
chromium_src-530f43f302f1eef9d3530767015891f1db1f1272.tar.gz
chromium_src-530f43f302f1eef9d3530767015891f1db1f1272.tar.bz2
Use ScopedComPtr instead of CComPtr to reduce a dependency on ATL.
BUG=5027 TEST=none Review URL: http://codereview.chromium.org/201012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google_update.cc')
-rw-r--r--chrome/browser/google_update.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/google_update.cc b/chrome/browser/google_update.cc
index 773c105..83b8c14 100644
--- a/chrome/browser/google_update.cc
+++ b/chrome/browser/google_update.cc
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
+#include "base/scoped_comptr_win.h"
#include "base/string_util.h"
#include "base/task.h"
#include "base/thread.h"
@@ -192,7 +193,7 @@ class GoogleUpdateJobObserver
// Allows us control the upgrade process to a small degree. After OnComplete
// has been called, this object can not be used.
- CComPtr<IProgressWndEvents> event_sink_;
+ ScopedComPtr<IProgressWndEvents> event_sink_;
};
////////////////////////////////////////////////////////////////////////////////
@@ -259,18 +260,18 @@ bool GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer,
main_loop);
}
- CComPtr<IJobObserver> job_holder(job_observer);
+ ScopedComPtr<IJobObserver> job_holder(job_observer);
- CComPtr<IGoogleUpdate> on_demand;
+ ScopedComPtr<IGoogleUpdate> on_demand;
if (InstallUtil::IsPerUserInstall(chrome_exe_path.c_str())) {
- hr = on_demand.CoCreateInstance(CLSID_OnDemandUserAppsClass);
+ hr = on_demand.CreateInstance(CLSID_OnDemandUserAppsClass);
} else {
// The Update operation needs Admin privileges for writing
// to %ProgramFiles%. On Vista we need to elevate before instantiating
// the updater instance.
if (!install_if_newer) {
- hr = on_demand.CoCreateInstance(CLSID_OnDemandMachineAppsClass);
+ hr = on_demand.CreateInstance(CLSID_OnDemandMachineAppsClass);
} else {
HWND foreground_hwnd = NULL;
if (window != NULL) {
@@ -278,8 +279,8 @@ bool GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer,
}
hr = CoCreateInstanceAsAdmin(CLSID_OnDemandMachineAppsClass,
- IID_IGoogleUpdate, foreground_hwnd,
- reinterpret_cast<void**>(&on_demand));
+ IID_IGoogleUpdate, foreground_hwnd,
+ reinterpret_cast<void**>(on_demand.Receive()));
}
}