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

Side by Side Diff: remoting/host/setup/daemon_controller_delegate_win.h

Issue 877343004: Move the |ElevatedDaemonController| implementation to |DaemonControllerDelegateWin| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | remoting/host/setup/daemon_controller_delegate_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_ 5 #ifndef REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_
6 #define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_ 6 #define REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_
7 7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/timer/timer.h"
10 #include "base/win/scoped_comptr.h"
11 // chromoting_lib.h contains MIDL-generated declarations.
12 #include "remoting/host/chromoting_lib.h"
13 #include "remoting/host/setup/daemon_controller.h" 8 #include "remoting/host/setup/daemon_controller.h"
14 9
15 namespace remoting { 10 namespace remoting {
16 11
17 class DaemonInstallerWin; 12 class DaemonInstallerWin;
18 13
19 class DaemonControllerDelegateWin : public DaemonController::Delegate { 14 class DaemonControllerDelegateWin : public DaemonController::Delegate {
20 public: 15 public:
21 DaemonControllerDelegateWin(); 16 DaemonControllerDelegateWin();
22 virtual ~DaemonControllerDelegateWin(); 17 virtual ~DaemonControllerDelegateWin();
23 18
24 // DaemonController::Delegate interface. 19 // DaemonController::Delegate interface.
25 virtual DaemonController::State GetState() override; 20 virtual DaemonController::State GetState() override;
26 virtual scoped_ptr<base::DictionaryValue> GetConfig() override; 21 virtual scoped_ptr<base::DictionaryValue> GetConfig() override;
27 virtual void SetConfigAndStart( 22 virtual void SetConfigAndStart(
28 scoped_ptr<base::DictionaryValue> config, 23 scoped_ptr<base::DictionaryValue> config,
29 bool consent, 24 bool consent,
30 const DaemonController::CompletionCallback& done) override; 25 const DaemonController::CompletionCallback& done) override;
31 virtual void UpdateConfig( 26 virtual void UpdateConfig(
32 scoped_ptr<base::DictionaryValue> config, 27 scoped_ptr<base::DictionaryValue> config,
33 const DaemonController::CompletionCallback& done) override; 28 const DaemonController::CompletionCallback& done) override;
34 virtual void Stop(const DaemonController::CompletionCallback& done) override; 29 virtual void Stop(const DaemonController::CompletionCallback& done) override;
35 virtual void SetWindow(void* window_handle) override; 30 virtual void SetWindow(void* window_handle) override;
36 virtual std::string GetVersion() override; 31 virtual std::string GetVersion() override;
37 virtual DaemonController::UsageStatsConsent GetUsageStatsConsent() override; 32 virtual DaemonController::UsageStatsConsent GetUsageStatsConsent() override;
38 33
39 private:
40 // Activates an unprivileged instance of the daemon controller and caches it.
41 HRESULT ActivateController();
42
43 // Activates an instance of the daemon controller and caches it. If COM
44 // Elevation is supported (Vista+) the activated instance is elevated,
45 // otherwise it is activated under credentials of the caller.
46 HRESULT ActivateElevatedController();
47
48 // Releases the cached instance of the controller.
49 void ReleaseController();
50
51 // |control_| and |control2_| hold references to an instance of the daemon
52 // controller to prevent a UAC prompt on every operation.
53 base::win::ScopedComPtr<IDaemonControl> control_;
54 base::win::ScopedComPtr<IDaemonControl2> control2_;
55
56 // True if |control_| holds a reference to an elevated instance of the daemon
57 // controller.
58 bool control_is_elevated_;
59
60 // This timer is used to release |control_| after a timeout.
61 scoped_ptr<base::OneShotTimer<DaemonControllerDelegateWin> > release_timer_;
62
63 // Handle of the plugin window.
64 HWND window_handle_;
65
66 DISALLOW_COPY_AND_ASSIGN(DaemonControllerDelegateWin); 34 DISALLOW_COPY_AND_ASSIGN(DaemonControllerDelegateWin);
67 }; 35 };
68 36
69 } // namespace remoting 37 } // namespace remoting
70 38
71 #endif // REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_ 39 #endif // REMOTING_HOST_SETUP_DAEMON_CONTROLLER_DELEGATE_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/setup/daemon_controller_delegate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698