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

Unified Diff: remoting/host/plugin/daemon_installer_win.cc

Issue 10535082: /C++ readability/ - Make Chromoting Host report crashes to Breakpad (Windows only). The user must e… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing omaha namespace. Created 8 years, 6 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
Index: remoting/host/plugin/daemon_installer_win.cc
diff --git a/remoting/host/plugin/daemon_installer_win.cc b/remoting/host/plugin/daemon_installer_win.cc
index 6eedd967f35bf19166b8eb813557554214c58d11..ddc830a085ed3c045daa9e254d886b8f44bd9ec1 100644
--- a/remoting/host/plugin/daemon_installer_win.cc
+++ b/remoting/host/plugin/daemon_installer_win.cc
@@ -19,10 +19,8 @@
#include "base/win/scoped_bstr.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
-
-namespace omaha {
#include "google_update/google_update_idl.h"
-} // namespace omaha
+#include "remoting/host/constants.h"
using base::win::ScopedBstr;
using base::win::ScopedComPtr;
@@ -44,10 +42,6 @@ const char16 kGoogleUpdateCommandLineFormat[] =
TO_L_STRING("\"%ls\" /install \"bundlename=Chromoting%%20Host&appguid=%ls&")
TO_L_STRING("appname=Chromoting%%20Host&needsadmin=True&lang=%ls\"");
-// The Omaha Appid of the host.
-const char16 kOmahaAppid[] =
- TO_L_STRING("{b210701e-ffc4-49e3-932b-370728c72662}");
-
// TODO(alexeypa): Get the desired laungage from the web app.
const char16 kOmahaLanguage[] = TO_L_STRING("en");
@@ -65,7 +59,7 @@ namespace remoting {
// per-machine Omaha instance.
class DaemonComInstallerWin : public DaemonInstallerWin {
public:
- DaemonComInstallerWin(const ScopedComPtr<omaha::IGoogleUpdate3Web>& update3,
+ DaemonComInstallerWin(const ScopedComPtr<IGoogleUpdate3Web>& update3,
const CompletionCallback& done);
// DaemonInstallerWin implementation.
@@ -77,9 +71,9 @@ class DaemonComInstallerWin : public DaemonInstallerWin {
void PollInstallationStatus();
// Omaha interfaces.
- ScopedComPtr<omaha::IAppWeb> app_;
- ScopedComPtr<omaha::IAppBundleWeb> bundle_;
- ScopedComPtr<omaha::IGoogleUpdate3Web> update3_;
+ ScopedComPtr<IAppWeb> app_;
+ ScopedComPtr<IAppBundleWeb> bundle_;
+ ScopedComPtr<IGoogleUpdate3Web> update3_;
base::Timer polling_timer_;
};
@@ -108,7 +102,7 @@ class DaemonCommandLineInstallerWin
};
DaemonComInstallerWin::DaemonComInstallerWin(
- const ScopedComPtr<omaha::IGoogleUpdate3Web>& update3,
+ const ScopedComPtr<IGoogleUpdate3Web>& update3,
const CompletionCallback& done)
: DaemonInstallerWin(done),
update3_(update3),
@@ -130,7 +124,7 @@ void DaemonComInstallerWin::Install() {
return;
}
- hr = dispatch.QueryInterface(omaha::IID_IAppBundleWeb, bundle_.ReceiveVoid());
+ hr = dispatch.QueryInterface(IID_IAppBundleWeb, bundle_.ReceiveVoid());
if (FAILED(hr)) {
Done(hr);
return;
@@ -143,7 +137,7 @@ void DaemonComInstallerWin::Install() {
}
// Add Chromoting Host to the bundle.
- ScopedBstr appid(kOmahaAppid);
+ ScopedBstr appid(kHostOmahaAppid);
ScopedBstr empty(kOmahaEmpty);
ScopedBstr language(kOmahaLanguage);
hr = bundle_->createApp(appid, empty, language, empty);
@@ -165,7 +159,7 @@ void DaemonComInstallerWin::Install() {
return;
}
- hr = dispatch.QueryInterface(omaha::IID_IAppWeb,
+ hr = dispatch.QueryInterface(IID_IAppWeb,
app_.ReceiveVoid());
if (FAILED(hr)) {
Done(hr);
@@ -188,8 +182,8 @@ void DaemonComInstallerWin::PollInstallationStatus() {
return;
}
- ScopedComPtr<omaha::ICurrentState> current_state;
- hr = dispatch.QueryInterface(omaha::IID_ICurrentState,
+ ScopedComPtr<ICurrentState> current_state;
+ hr = dispatch.QueryInterface(IID_ICurrentState,
current_state.ReceiveVoid());
if (FAILED(hr)) {
Done(hr);
@@ -205,18 +199,18 @@ void DaemonComInstallerWin::PollInstallationStatus() {
// Perform state-specific actions.
switch (state) {
- case omaha::STATE_INIT:
- case omaha::STATE_WAITING_TO_CHECK_FOR_UPDATE:
- case omaha::STATE_CHECKING_FOR_UPDATE:
- case omaha::STATE_WAITING_TO_DOWNLOAD:
- case omaha::STATE_RETRYING_DOWNLOAD:
- case omaha::STATE_DOWNLOADING:
- case omaha::STATE_WAITING_TO_INSTALL:
- case omaha::STATE_INSTALLING:
- case omaha::STATE_PAUSED:
+ case STATE_INIT:
+ case STATE_WAITING_TO_CHECK_FOR_UPDATE:
+ case STATE_CHECKING_FOR_UPDATE:
+ case STATE_WAITING_TO_DOWNLOAD:
+ case STATE_RETRYING_DOWNLOAD:
+ case STATE_DOWNLOADING:
+ case STATE_WAITING_TO_INSTALL:
+ case STATE_INSTALLING:
+ case STATE_PAUSED:
break;
- case omaha::STATE_UPDATE_AVAILABLE:
+ case STATE_UPDATE_AVAILABLE:
hr = bundle_->download();
if (FAILED(hr)) {
Done(hr);
@@ -224,10 +218,10 @@ void DaemonComInstallerWin::PollInstallationStatus() {
}
break;
- case omaha::STATE_DOWNLOAD_COMPLETE:
- case omaha::STATE_EXTRACTING:
- case omaha::STATE_APPLYING_DIFFERENTIAL_PATCH:
- case omaha::STATE_READY_TO_INSTALL:
+ case STATE_DOWNLOAD_COMPLETE:
+ case STATE_EXTRACTING:
+ case STATE_APPLYING_DIFFERENTIAL_PATCH:
+ case STATE_READY_TO_INSTALL:
hr = bundle_->install();
if (FAILED(hr)) {
Done(hr);
@@ -235,13 +229,13 @@ void DaemonComInstallerWin::PollInstallationStatus() {
}
break;
- case omaha::STATE_INSTALL_COMPLETE:
- case omaha::STATE_NO_UPDATE:
+ case STATE_INSTALL_COMPLETE:
+ case STATE_NO_UPDATE:
// Installation complete or not required. Report success.
Done(S_OK);
return;
- case omaha::STATE_ERROR: {
+ case STATE_ERROR: {
HRESULT error_code;
hr = current_state->get_errorCode(&error_code);
if (FAILED(hr)) {
@@ -292,7 +286,7 @@ void DaemonCommandLineInstallerWin::Install() {
string16 command_line =
StringPrintf(kGoogleUpdateCommandLineFormat,
google_update.c_str(),
- kOmahaAppid,
+ kHostOmahaAppid,
kOmahaLanguage);
base::LaunchOptions options;
@@ -341,11 +335,11 @@ scoped_ptr<DaemonInstallerWin> DaemonInstallerWin::Create(
bind_options.hwnd = GetTopLevelWindow(window_handle);
bind_options.dwClassContext = CLSCTX_LOCAL_SERVER;
- ScopedComPtr<omaha::IGoogleUpdate3Web> update3;
+ ScopedComPtr<IGoogleUpdate3Web> update3;
HRESULT result = ::CoGetObject(
kOmahaElevationMoniker,
&bind_options,
- omaha::IID_IGoogleUpdate3Web,
+ IID_IGoogleUpdate3Web,
update3.ReceiveVoid());
if (SUCCEEDED(result)) {
// The machine instance of Omaha is available and we successfully passed

Powered by Google App Engine
This is Rietveld 408576698