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

Side by Side Diff: remoting/host/host_window_proxy.cc

Issue 112453002: Remove dependency on skia from remoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/host_status_observer.h ('k') | remoting/host/input_injector_linux.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/host/host_window_proxy.h" 5 #include "remoting/host/host_window_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "remoting/host/client_session_control.h" 11 #include "remoting/host/client_session_control.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
12 13
13 namespace remoting { 14 namespace remoting {
14 15
15 // Runs an instance of |HostWindow| on the |ui_task_runner_| thread. 16 // Runs an instance of |HostWindow| on the |ui_task_runner_| thread.
16 class HostWindowProxy::Core 17 class HostWindowProxy::Core
17 : public base::RefCountedThreadSafe<Core>, 18 : public base::RefCountedThreadSafe<Core>,
18 public ClientSessionControl { 19 public ClientSessionControl {
19 public: 20 public:
20 Core(scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, 21 Core(scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
21 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, 22 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
22 scoped_ptr<HostWindow> host_window); 23 scoped_ptr<HostWindow> host_window);
23 24
24 // Starts |host_window_| on the |ui_task_runner_| thread. 25 // Starts |host_window_| on the |ui_task_runner_| thread.
25 void Start(const base::WeakPtr<ClientSessionControl>& client_session_control); 26 void Start(const base::WeakPtr<ClientSessionControl>& client_session_control);
26 27
27 // Destroys |host_window_| on the |ui_task_runner_| thread. 28 // Destroys |host_window_| on the |ui_task_runner_| thread.
28 void Stop(); 29 void Stop();
29 30
30 private: 31 private:
31 friend class base::RefCountedThreadSafe<Core>; 32 friend class base::RefCountedThreadSafe<Core>;
32 virtual ~Core(); 33 virtual ~Core();
33 34
34 // Start() and Stop() equivalents called on the |ui_task_runner_| thread. 35 // Start() and Stop() equivalents called on the |ui_task_runner_| thread.
35 void StartOnUiThread(const std::string& client_jid); 36 void StartOnUiThread(const std::string& client_jid);
36 void StopOnUiThread(); 37 void StopOnUiThread();
37 38
38 // ClientSessionControl interface. 39 // ClientSessionControl interface.
39 virtual const std::string& client_jid() const OVERRIDE; 40 virtual const std::string& client_jid() const OVERRIDE;
40 virtual void DisconnectSession() OVERRIDE; 41 virtual void DisconnectSession() OVERRIDE;
41 virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE; 42 virtual void OnLocalMouseMoved(
43 const webrtc::DesktopVector& position) OVERRIDE;
42 virtual void SetDisableInputs(bool disable_inputs) OVERRIDE; 44 virtual void SetDisableInputs(bool disable_inputs) OVERRIDE;
43 45
44 // Task runner on which public methods of this class must be called. 46 // Task runner on which public methods of this class must be called.
45 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; 47 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
46 48
47 // Task runner on which |host_window_| is running. 49 // Task runner on which |host_window_| is running.
48 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 50 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
49 51
50 // Stores the client's JID so it can be read on the |ui_task_runner_| thread. 52 // Stores the client's JID so it can be read on the |ui_task_runner_| thread.
51 std::string client_jid_; 53 std::string client_jid_;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (!caller_task_runner_->BelongsToCurrentThread()) { 147 if (!caller_task_runner_->BelongsToCurrentThread()) {
146 caller_task_runner_->PostTask(FROM_HERE, 148 caller_task_runner_->PostTask(FROM_HERE,
147 base::Bind(&Core::DisconnectSession, this)); 149 base::Bind(&Core::DisconnectSession, this));
148 return; 150 return;
149 } 151 }
150 152
151 if (client_session_control_.get()) 153 if (client_session_control_.get())
152 client_session_control_->DisconnectSession(); 154 client_session_control_->DisconnectSession();
153 } 155 }
154 156
155 void HostWindowProxy::Core::OnLocalMouseMoved(const SkIPoint& position) { 157 void HostWindowProxy::Core::OnLocalMouseMoved(
158 const webrtc::DesktopVector& position) {
156 if (!caller_task_runner_->BelongsToCurrentThread()) { 159 if (!caller_task_runner_->BelongsToCurrentThread()) {
157 caller_task_runner_->PostTask( 160 caller_task_runner_->PostTask(
158 FROM_HERE, base::Bind(&Core::OnLocalMouseMoved, this, position)); 161 FROM_HERE, base::Bind(&Core::OnLocalMouseMoved, this, position));
159 return; 162 return;
160 } 163 }
161 164
162 if (client_session_control_.get()) 165 if (client_session_control_.get())
163 client_session_control_->OnLocalMouseMoved(position); 166 client_session_control_->OnLocalMouseMoved(position);
164 } 167 }
165 168
166 void HostWindowProxy::Core::SetDisableInputs(bool disable_inputs) { 169 void HostWindowProxy::Core::SetDisableInputs(bool disable_inputs) {
167 if (!caller_task_runner_->BelongsToCurrentThread()) { 170 if (!caller_task_runner_->BelongsToCurrentThread()) {
168 caller_task_runner_->PostTask( 171 caller_task_runner_->PostTask(
169 FROM_HERE, base::Bind(&Core::SetDisableInputs, this, disable_inputs)); 172 FROM_HERE, base::Bind(&Core::SetDisableInputs, this, disable_inputs));
170 return; 173 return;
171 } 174 }
172 175
173 if (client_session_control_.get()) 176 if (client_session_control_.get())
174 client_session_control_->SetDisableInputs(disable_inputs); 177 client_session_control_->SetDisableInputs(disable_inputs);
175 } 178 }
176 179
177 } // namespace remoting 180 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_status_observer.h ('k') | remoting/host/input_injector_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698