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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 } | 57 } |
58 | 58 |
59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
60 return ui_task_runner_; | 60 return ui_task_runner_; |
61 } | 61 } |
62 | 62 |
63 webrtc::DesktopCaptureOptions* desktop_capture_options() { | 63 webrtc::DesktopCaptureOptions* desktop_capture_options() { |
64 return desktop_capture_options_.get(); | 64 return desktop_capture_options_.get(); |
65 } | 65 } |
66 | 66 |
67 // Enables or disables touch events capability. | |
Wez
2015/05/21 00:59:14
nit: This comment doesn't really add anything.
Rintaro Kuroiwa
2015/05/21 21:53:29
Done. REmoved.
| |
68 void set_supports_touch_events(bool enable) { | |
Wez
2015/05/21 00:59:14
Do you need this setter, or can you just make it a
Rintaro Kuroiwa
2015/05/21 21:53:29
No we don't. It just requires changes to classes t
| |
69 supports_touch_events_ = enable; | |
70 } | |
71 | |
67 private: | 72 private: |
68 // Task runner on which methods of DesktopEnvironment interface should be | 73 // Task runner on which methods of DesktopEnvironment interface should be |
69 // called. | 74 // called. |
70 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 75 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
71 | 76 |
72 // Used to run input-related tasks. | 77 // Used to run input-related tasks. |
73 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
74 | 79 |
75 // Used to run UI code. | 80 // Used to run UI code. |
76 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 81 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
77 | 82 |
78 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It | 83 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It |
79 // might contain expensive resources, thus justifying the sharing. | 84 // might contain expensive resources, thus justifying the sharing. |
80 // Also: it's dynamically allocated to avoid having to bring in | 85 // Also: it's dynamically allocated to avoid having to bring in |
81 // desktop_capture_options.h which brings in X11 headers which causes hard to | 86 // desktop_capture_options.h which brings in X11 headers which causes hard to |
82 // find build errors. | 87 // find build errors. |
83 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; | 88 scoped_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; |
84 | 89 |
90 // True if the desktop environment supports touch events capability. | |
Wez
2015/05/21 00:59:14
nit: True if the touch events capability should be
Rintaro Kuroiwa
2015/05/21 21:53:29
Done.
| |
91 bool supports_touch_events_; | |
92 | |
85 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); | 93 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); |
86 }; | 94 }; |
87 | 95 |
88 // Used to create |BasicDesktopEnvironment| instances. | 96 // Used to create |BasicDesktopEnvironment| instances. |
89 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { | 97 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { |
90 public: | 98 public: |
91 BasicDesktopEnvironmentFactory( | 99 BasicDesktopEnvironmentFactory( |
92 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 100 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
93 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 101 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
94 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 102 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
95 ~BasicDesktopEnvironmentFactory() override; | 103 ~BasicDesktopEnvironmentFactory() override; |
96 | 104 |
97 // DesktopEnvironmentFactory implementation. | 105 // DesktopEnvironmentFactory implementation. |
98 bool SupportsAudioCapture() const override; | 106 bool SupportsAudioCapture() const override; |
99 | 107 |
100 protected: | 108 protected: |
101 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { | 109 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { |
102 return caller_task_runner_; | 110 return caller_task_runner_; |
103 } | 111 } |
104 | 112 |
105 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { | 113 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { |
106 return input_task_runner_; | 114 return input_task_runner_; |
107 } | 115 } |
108 | 116 |
109 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { | 117 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { |
110 return ui_task_runner_; | 118 return ui_task_runner_; |
111 } | 119 } |
112 | 120 |
121 // Enables or disables touch events capability. | |
Wez
2015/05/21 00:59:14
It actually configures whether DesktopEnvironments
Rintaro Kuroiwa
2015/05/21 21:53:29
Removed this comment since these are just accessor
| |
122 void set_supports_touch_events(bool enable) { | |
123 supports_touch_events_ = enable; | |
124 } | |
125 bool supports_touch_events() const { return supports_touch_events_; } | |
126 | |
113 private: | 127 private: |
114 // Task runner on which methods of DesktopEnvironmentFactory interface should | 128 // Task runner on which methods of DesktopEnvironmentFactory interface should |
115 // be called. | 129 // be called. |
116 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 130 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
117 | 131 |
118 // Used to run input-related tasks. | 132 // Used to run input-related tasks. |
119 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 133 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
120 | 134 |
121 // Used to run UI code. | 135 // Used to run UI code. |
122 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 136 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
123 | 137 |
138 // If true then the newly Create()ed desktop environments support touch | |
139 // events. | |
Wez
2015/05/21 00:59:14
Suggest phrasing this the same as the equivalent c
Rintaro Kuroiwa
2015/05/21 21:53:29
Done.
| |
140 bool supports_touch_events_; | |
141 | |
124 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); | 142 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); |
125 }; | 143 }; |
126 | 144 |
127 } // namespace remoting | 145 } // namespace remoting |
128 | 146 |
129 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ | 147 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ |
OLD | NEW |