| 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_DESKTOP_SESSION_AGENT_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
| 6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 DesktopSessionAgent( | 66 DesktopSessionAgent( |
| 67 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, | 67 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, |
| 68 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 68 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 69 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 69 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
| 70 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 70 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 71 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner); | 71 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner); |
| 72 | 72 |
| 73 // IPC::Listener implementation. | 73 // IPC::Listener implementation. |
| 74 virtual bool OnMessageReceived(const IPC::Message& message) override; | 74 bool OnMessageReceived(const IPC::Message& message) override; |
| 75 virtual void OnChannelConnected(int32 peer_pid) override; | 75 void OnChannelConnected(int32 peer_pid) override; |
| 76 virtual void OnChannelError() override; | 76 void OnChannelError() override; |
| 77 | 77 |
| 78 // webrtc::DesktopCapturer::Callback implementation. | 78 // webrtc::DesktopCapturer::Callback implementation. |
| 79 virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) override; | 79 webrtc::SharedMemory* CreateSharedMemory(size_t size) override; |
| 80 virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; | 80 void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; |
| 81 | 81 |
| 82 // webrtc::MouseCursorMonitor::Callback implementation. | 82 // webrtc::MouseCursorMonitor::Callback implementation. |
| 83 virtual void OnMouseCursor(webrtc::MouseCursor* cursor) override; | 83 void OnMouseCursor(webrtc::MouseCursor* cursor) override; |
| 84 virtual void OnMouseCursorPosition( | 84 void OnMouseCursorPosition(webrtc::MouseCursorMonitor::CursorState state, |
| 85 webrtc::MouseCursorMonitor::CursorState state, | 85 const webrtc::DesktopVector& position) override; |
| 86 const webrtc::DesktopVector& position) override; | |
| 87 | 86 |
| 88 // Forwards a local clipboard event though the IPC channel to the network | 87 // Forwards a local clipboard event though the IPC channel to the network |
| 89 // process. | 88 // process. |
| 90 void InjectClipboardEvent(const protocol::ClipboardEvent& event); | 89 void InjectClipboardEvent(const protocol::ClipboardEvent& event); |
| 91 | 90 |
| 92 // Forwards an audio packet though the IPC channel to the network process. | 91 // Forwards an audio packet though the IPC channel to the network process. |
| 93 void ProcessAudioPacket(scoped_ptr<AudioPacket> packet); | 92 void ProcessAudioPacket(scoped_ptr<AudioPacket> packet); |
| 94 | 93 |
| 95 // Creates desktop integration components and a connected IPC channel to be | 94 // Creates desktop integration components and a connected IPC channel to be |
| 96 // used to access them. The client end of the channel is returned in | 95 // used to access them. The client end of the channel is returned in |
| 97 // the variable pointed by |desktop_pipe_out|. | 96 // the variable pointed by |desktop_pipe_out|. |
| 98 bool Start(const base::WeakPtr<Delegate>& delegate, | 97 bool Start(const base::WeakPtr<Delegate>& delegate, |
| 99 IPC::PlatformFileForTransit* desktop_pipe_out); | 98 IPC::PlatformFileForTransit* desktop_pipe_out); |
| 100 | 99 |
| 101 // Stops the agent asynchronously. | 100 // Stops the agent asynchronously. |
| 102 void Stop(); | 101 void Stop(); |
| 103 | 102 |
| 104 protected: | 103 protected: |
| 105 friend class base::RefCountedThreadSafe<DesktopSessionAgent>; | 104 friend class base::RefCountedThreadSafe<DesktopSessionAgent>; |
| 106 | 105 |
| 107 virtual ~DesktopSessionAgent(); | 106 ~DesktopSessionAgent() override; |
| 108 | 107 |
| 109 // ClientSessionControl interface. | 108 // ClientSessionControl interface. |
| 110 virtual const std::string& client_jid() const override; | 109 const std::string& client_jid() const override; |
| 111 virtual void DisconnectSession() override; | 110 void DisconnectSession() override; |
| 112 virtual void OnLocalMouseMoved( | 111 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; |
| 113 const webrtc::DesktopVector& position) override; | 112 void SetDisableInputs(bool disable_inputs) override; |
| 114 virtual void SetDisableInputs(bool disable_inputs) override; | 113 void ResetVideoPipeline() override; |
| 115 virtual void ResetVideoPipeline() override; | |
| 116 | 114 |
| 117 // Handles StartSessionAgent request from the client. | 115 // Handles StartSessionAgent request from the client. |
| 118 void OnStartSessionAgent(const std::string& authenticated_jid, | 116 void OnStartSessionAgent(const std::string& authenticated_jid, |
| 119 const ScreenResolution& resolution, | 117 const ScreenResolution& resolution, |
| 120 bool virtual_terminal); | 118 bool virtual_terminal); |
| 121 | 119 |
| 122 // Handles CaptureFrame requests from the client. | 120 // Handles CaptureFrame requests from the client. |
| 123 void OnCaptureFrame(); | 121 void OnCaptureFrame(); |
| 124 | 122 |
| 125 // Handles SharedBufferCreated notification from the client. | 123 // Handles SharedBufferCreated notification from the client. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 225 |
| 228 // Used to disable callbacks to |this|. | 226 // Used to disable callbacks to |this|. |
| 229 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_; | 227 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_; |
| 230 | 228 |
| 231 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); | 229 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); |
| 232 }; | 230 }; |
| 233 | 231 |
| 234 } // namespace remoting | 232 } // namespace remoting |
| 235 | 233 |
| 236 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ | 234 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
| OLD | NEW |