OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | |
6 #define REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | |
7 | |
8 #include <atlbase.h> | |
9 #include <atlcom.h> | |
10 #include <atlctl.h> | |
11 | |
12 #include "remoting/base/scoped_sc_handle_win.h" | |
13 | |
14 // MIDL-generated declarations. | |
15 #include "remoting/host/elevated_controller.h" | |
16 | |
17 namespace remoting { | |
18 | |
19 class ATL_NO_VTABLE ElevatedControllerWin | |
20 : public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>, | |
21 public ATL::CComCoClass<ElevatedControllerWin, &CLSID_ElevatedController>, | |
22 public ATL::IDispatchImpl<IDaemonControl2, &IID_IDaemonControl2, | |
23 &LIBID_ChromotingElevatedControllerLib, 1, 1> { | |
24 public: | |
25 ElevatedControllerWin(); | |
26 | |
27 HRESULT FinalConstruct(); | |
28 void FinalRelease(); | |
29 | |
30 // IDaemonControl implementation. | |
31 STDMETHOD(GetConfig)(BSTR* config_out); | |
32 STDMETHOD(GetVersion)(BSTR* version_out); | |
33 STDMETHOD(SetConfig)(BSTR config); | |
34 STDMETHOD(SetOwnerWindow)(LONG_PTR owner_window); | |
35 STDMETHOD(StartDaemon)(); | |
36 STDMETHOD(StopDaemon)(); | |
37 STDMETHOD(UpdateConfig)(BSTR config); | |
38 | |
39 // IDaemonControl2 implementation. | |
40 STDMETHOD(GetUsageStatsConsent)(BOOL* allowed, BOOL* set_by_policy); | |
41 STDMETHOD(SetUsageStatsConsent)(BOOL allowed); | |
42 | |
43 DECLARE_NO_REGISTRY() | |
44 | |
45 private: | |
46 HRESULT OpenService(ScopedScHandle* service_out); | |
47 | |
48 BEGIN_COM_MAP(ElevatedControllerWin) | |
49 COM_INTERFACE_ENTRY(IDaemonControl) | |
50 COM_INTERFACE_ENTRY(IDaemonControl2) | |
51 COM_INTERFACE_ENTRY(IDispatch) | |
52 END_COM_MAP() | |
53 | |
54 // Handle of the owner window (if any) for any UI to be shown. | |
55 HWND owner_window_; | |
56 | |
57 DECLARE_PROTECT_FINAL_CONSTRUCT() | |
58 }; | |
59 | |
60 OBJECT_ENTRY_AUTO(CLSID_ElevatedController, ElevatedControllerWin) | |
61 | |
62 } // namespace remoting | |
63 | |
64 #endif // REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | |
OLD | NEW |