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

Side by Side Diff: remoting/host/basic_desktop_environment.h

Issue 2458513004: Revert of Remove supports_touch_events flag from BasicDesktopEnvironment (Closed)
Patch Set: Created 4 years, 1 month 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/basic_desktop_environment.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 (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 <cstdint> 8 #include <cstdint>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 28 matching lines...) Expand all
39 void SetCapabilities(const std::string& capabilities) override; 39 void SetCapabilities(const std::string& capabilities) override;
40 uint32_t GetDesktopSessionId() const override; 40 uint32_t GetDesktopSessionId() const override;
41 41
42 protected: 42 protected:
43 friend class BasicDesktopEnvironmentFactory; 43 friend class BasicDesktopEnvironmentFactory;
44 44
45 BasicDesktopEnvironment( 45 BasicDesktopEnvironment(
46 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 46 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
47 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, 47 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 48 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); 49 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
50 bool supports_touch_events);
50 51
51 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { 52 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const {
52 return caller_task_runner_; 53 return caller_task_runner_;
53 } 54 }
54 55
55 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner() 56 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner()
56 const { 57 const {
57 return video_capture_task_runner_; 58 return video_capture_task_runner_;
58 } 59 }
59 60
(...skipping 23 matching lines...) Expand all
83 // Used to run UI code. 84 // Used to run UI code.
84 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 85 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
85 86
86 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It 87 // Options shared between |DesktopCapturer| and |MouseCursorMonitor|. It
87 // might contain expensive resources, thus justifying the sharing. 88 // might contain expensive resources, thus justifying the sharing.
88 // Also: it's dynamically allocated to avoid having to bring in 89 // Also: it's dynamically allocated to avoid having to bring in
89 // desktop_capture_options.h which brings in X11 headers which causes hard to 90 // desktop_capture_options.h which brings in X11 headers which causes hard to
90 // find build errors. 91 // find build errors.
91 std::unique_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_; 92 std::unique_ptr<webrtc::DesktopCaptureOptions> desktop_capture_options_;
92 93
94 // True if the touch events capability should be offered.
95 const bool supports_touch_events_;
96
93 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment); 97 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment);
94 }; 98 };
95 99
96 // Used to create |BasicDesktopEnvironment| instances. 100 // Used to create |BasicDesktopEnvironment| instances.
97 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory { 101 class BasicDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
98 public: 102 public:
99 BasicDesktopEnvironmentFactory( 103 BasicDesktopEnvironmentFactory(
100 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 104 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
101 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, 105 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
102 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, 106 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
103 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); 107 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
104 ~BasicDesktopEnvironmentFactory() override; 108 ~BasicDesktopEnvironmentFactory() override;
105 109
106 // DesktopEnvironmentFactory implementation. 110 // DesktopEnvironmentFactory implementation.
107 bool SupportsAudioCapture() const override; 111 bool SupportsAudioCapture() const override;
108 112
113 void set_supports_touch_events(bool enable) {
114 supports_touch_events_ = enable;
115 }
116
109 protected: 117 protected:
110 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const { 118 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner() const {
111 return caller_task_runner_; 119 return caller_task_runner_;
112 } 120 }
113 121
114 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner() 122 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner()
115 const { 123 const {
116 return video_capture_task_runner_; 124 return video_capture_task_runner_;
117 } 125 }
118 126
119 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const { 127 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner() const {
120 return input_task_runner_; 128 return input_task_runner_;
121 } 129 }
122 130
123 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const { 131 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner() const {
124 return ui_task_runner_; 132 return ui_task_runner_;
125 } 133 }
126 134
135 bool supports_touch_events() const { return supports_touch_events_; }
136
127 private: 137 private:
128 // Task runner on which methods of DesktopEnvironmentFactory interface should 138 // Task runner on which methods of DesktopEnvironmentFactory interface should
129 // be called. 139 // be called.
130 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; 140 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
131 141
132 // Used to run video capture tasks. 142 // Used to run video capture tasks.
133 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; 143 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_;
134 144
135 // Used to run input-related tasks. 145 // Used to run input-related tasks.
136 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; 146 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_;
137 147
138 // Used to run UI code. 148 // Used to run UI code.
139 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 149 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
140 150
151 // True if the touch events capability should be offered by the
152 // DesktopEnvironment instances.
153 bool supports_touch_events_;
154
141 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory); 155 DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory);
142 }; 156 };
143 157
144 } // namespace remoting 158 } // namespace remoting
145 159
146 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_ 160 #endif // REMOTING_HOST_BASIC_DESKTOP_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/basic_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698