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_BASIC_DESKTOP_ENVIRONMENT_H_ | 5 #ifndef REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
6 #define REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 6 #define REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "remoting/host/desktop_environment.h" | 12 #include "remoting/host/desktop_environment.h" |
12 #include "remoting/host/ui_strings.h" | 13 #include "remoting/host/ui_strings.h" |
13 | 14 |
14 namespace remoting { | 15 namespace remoting { |
15 | 16 |
16 class HostWindow; | 17 class HostWindow; |
17 class LocalInputMonitor; | 18 class LocalInputMonitor; |
18 | 19 |
19 // Used to create audio/video capturers and event executor that work with | 20 // Used to create audio/video capturers and event executor that work with |
20 // the local console. | 21 // the local console. |
(...skipping 10 matching lines...) Expand all Loading... |
31 protected: | 32 protected: |
32 friend class BasicDesktopEnvironmentFactory; | 33 friend class BasicDesktopEnvironmentFactory; |
33 | 34 |
34 // |ui_strings| are hosted by the BasicDesktopEnvironmentFactory instance that | 35 // |ui_strings| are hosted by the BasicDesktopEnvironmentFactory instance that |
35 // created |this|. |ui_strings| must outlive this object. | 36 // created |this|. |ui_strings| must outlive this object. |
36 BasicDesktopEnvironment( | 37 BasicDesktopEnvironment( |
37 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 38 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
38 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
39 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 40 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
40 base::WeakPtr<ClientSessionControl> client_session_control, | 41 base::WeakPtr<ClientSessionControl> client_session_control, |
41 const UiStrings* ui_strings); | 42 const UiStrings& ui_strings); |
42 | 43 |
43 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 44 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
44 return caller_task_runner_; | 45 return caller_task_runner_; |
45 } | 46 } |
46 | 47 |
47 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
48 return input_task_runner_; | 49 return input_task_runner_; |
49 } | 50 } |
50 | 51 |
51 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 52 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
52 return ui_task_runner_; | 53 return ui_task_runner_; |
53 } | 54 } |
54 | 55 |
55 const UiStrings* ui_strings() const { return ui_strings_; } | |
56 | |
57 private: | 56 private: |
58 // Task runner on which methods of DesktopEnvironment interface should be | 57 // Task runner on which methods of DesktopEnvironment interface should be |
59 // called. | 58 // called. |
60 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 59 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
61 | 60 |
62 // Used to run input-related tasks. | 61 // Used to run input-related tasks. |
63 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 62 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
64 | 63 |
65 // Used to run UI code. | 64 // Used to run UI code. |
66 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 65 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
67 | 66 |
68 // Presents the disconnect window to the local user. | 67 // Presents the disconnect window to the local user. |
69 scoped_ptr<HostWindow> disconnect_window_; | 68 scoped_ptr<HostWindow> disconnect_window_; |
70 | 69 |
71 // Notifies the client session about the local mouse movements. | 70 // Notifies the client session about the local mouse movements. |
72 scoped_ptr<LocalInputMonitor> local_input_monitor_; | 71 scoped_ptr<LocalInputMonitor> local_input_monitor_; |
73 | 72 |
74 // Points to the localized UI strings. | |
75 const UiStrings* ui_strings_; | |
76 | |
77 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 73 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
78 }; | 74 }; |
79 | 75 |
80 // Used to create |BasicDesktopEnvironment| instances. | 76 // Used to create |BasicDesktopEnvironment| instances. |
81 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 77 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
82 public: | 78 public: |
83 BasicDesktopEnvironmentFactory( | 79 BasicDesktopEnvironmentFactory( |
84 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 80 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
85 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 81 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
86 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 82 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 116 |
121 // Contains a copy of the localized UI strings. | 117 // Contains a copy of the localized UI strings. |
122 const UiStrings ui_strings_; | 118 const UiStrings ui_strings_; |
123 | 119 |
124 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 120 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
125 }; | 121 }; |
126 | 122 |
127 } // namespace remoting | 123 } // namespace remoting |
128 | 124 |
129 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 125 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
OLD | NEW |