Commit 69cccfce authored by weitaosu's avatar weitaosu Committed by Commit bot

Move the |ElevatedDaemonController| implementation to |DaemonControllerDelegateWin|

Changes in this CL include:
1. Moved the daemon controller implemetation from |ElevatedDaemonController| to |DaemonControllerDelegateWin|
2. Removed all code related to COM activation in |DaemonControllerDelegateWin|.
3. Removed code related to SetOwnerWindow in |DaemonControllerDelegateWin|.
4. Removed code related to the pin confirmation dialog in |DaemonControllerDelegateWin|
5. Cleaned up the COM-styled code to make it adhere to the chromium coding styles.

BUG=453172

Review URL: https://codereview.chromium.org/877343004

Cr-Commit-Position: refs/heads/master@{#315129}
parent c2e11810
......@@ -5,11 +5,6 @@
#ifndef REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_
#define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
#include "base/win/scoped_comptr.h"
// chromoting_lib.h contains MIDL-generated declarations.
#include "remoting/host/chromoting_lib.h"
#include "remoting/host/setup/daemon_controller.h"
namespace remoting {
......@@ -36,33 +31,6 @@ class DaemonControllerDelegateWin : public DaemonController::Delegate {
virtual std::string GetVersion() override;
virtual DaemonController::UsageStatsConsent GetUsageStatsConsent() override;
private:
// Activates an unprivileged instance of the daemon controller and caches it.
HRESULT ActivateController();
// Activates an instance of the daemon controller and caches it. If COM
// Elevation is supported (Vista+) the activated instance is elevated,
// otherwise it is activated under credentials of the caller.
HRESULT ActivateElevatedController();
// Releases the cached instance of the controller.
void ReleaseController();
// |control_| and |control2_| hold references to an instance of the daemon
// controller to prevent a UAC prompt on every operation.
base::win::ScopedComPtr<IDaemonControl> control_;
base::win::ScopedComPtr<IDaemonControl2> control2_;
// True if |control_| holds a reference to an elevated instance of the daemon
// controller.
bool control_is_elevated_;
// This timer is used to release |control_| after a timeout.
scoped_ptr<base::OneShotTimer<DaemonControllerDelegateWin> > release_timer_;
// Handle of the plugin window.
HWND window_handle_;
DISALLOW_COPY_AND_ASSIGN(DaemonControllerDelegateWin);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment