OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_WIN_HOST_SERVICE_H_ | 5 #ifndef REMOTING_HOST_WIN_HOST_SERVICE_H_ |
6 #define REMOTING_HOST_WIN_HOST_SERVICE_H_ | 6 #define REMOTING_HOST_WIN_HOST_SERVICE_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 15 #include "base/win/message_window.h" |
15 #include "net/base/ip_endpoint.h" | 16 #include "net/base/ip_endpoint.h" |
16 #include "remoting/host/win/message_window.h" | |
17 #include "remoting/host/win/wts_terminal_monitor.h" | 17 #include "remoting/host/win/wts_terminal_monitor.h" |
18 | 18 |
19 class CommandLine; | 19 class CommandLine; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
23 } // namespace base | 23 } // namespace base |
24 | 24 |
25 namespace remoting { | 25 namespace remoting { |
26 | 26 |
27 class AutoThreadTaskRunner; | 27 class AutoThreadTaskRunner; |
28 class Stoppable; | 28 class Stoppable; |
29 class WtsTerminalObserver; | 29 class WtsTerminalObserver; |
30 | 30 |
31 class HostService : public win::MessageWindow::Delegate, | 31 class HostService : public base::win::MessageWindow::Delegate, |
32 public WtsTerminalMonitor { | 32 public WtsTerminalMonitor { |
33 public: | 33 public: |
34 static HostService* GetInstance(); | 34 static HostService* GetInstance(); |
35 | 35 |
36 // This function parses the command line and selects the action routine. | 36 // This function parses the command line and selects the action routine. |
37 bool InitWithCommandLine(const CommandLine* command_line); | 37 bool InitWithCommandLine(const CommandLine* command_line); |
38 | 38 |
39 // Invoke the choosen action routine. | 39 // Invoke the choosen action routine. |
40 int Run(); | 40 int Run(); |
41 | 41 |
(...skipping 21 matching lines...) Expand all Loading... |
63 | 63 |
64 // Runs the service on the service thread. A separate routine is used to make | 64 // Runs the service on the service thread. A separate routine is used to make |
65 // sure all local objects are destoyed by the time |stopped_event_| is | 65 // sure all local objects are destoyed by the time |stopped_event_| is |
66 // signalled. | 66 // signalled. |
67 void RunAsServiceImpl(); | 67 void RunAsServiceImpl(); |
68 | 68 |
69 // This function starts the service in interactive mode (i.e. as a plain | 69 // This function starts the service in interactive mode (i.e. as a plain |
70 // console application). | 70 // console application). |
71 int RunInConsole(); | 71 int RunInConsole(); |
72 | 72 |
73 // win::MessageWindow::Delegate interface. | 73 // base::win::MessageWindow::Delegate interface. |
74 virtual bool HandleMessage(HWND hwnd, | 74 virtual bool HandleMessage(HWND hwnd, |
75 UINT message, | 75 UINT message, |
76 WPARAM wparam, | 76 WPARAM wparam, |
77 LPARAM lparam, | 77 LPARAM lparam, |
78 LRESULT* result) OVERRIDE; | 78 LRESULT* result) OVERRIDE; |
79 | 79 |
80 static BOOL WINAPI ConsoleControlHandler(DWORD event); | 80 static BOOL WINAPI ConsoleControlHandler(DWORD event); |
81 | 81 |
82 // The control handler of the service. | 82 // The control handler of the service. |
83 static DWORD WINAPI ServiceControlHandler(DWORD control, | 83 static DWORD WINAPI ServiceControlHandler(DWORD control, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 // Singleton. | 122 // Singleton. |
123 friend struct DefaultSingletonTraits<HostService>; | 123 friend struct DefaultSingletonTraits<HostService>; |
124 | 124 |
125 DISALLOW_COPY_AND_ASSIGN(HostService); | 125 DISALLOW_COPY_AND_ASSIGN(HostService); |
126 }; | 126 }; |
127 | 127 |
128 } // namespace remoting | 128 } // namespace remoting |
129 | 129 |
130 #endif // REMOTING_HOST_WIN_HOST_SERVICE_H_ | 130 #endif // REMOTING_HOST_WIN_HOST_SERVICE_H_ |
OLD | NEW |