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 <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace IPC { | 26 namespace IPC { |
27 class ChannelProxy; | 27 class ChannelProxy; |
28 class Message; | 28 class Message; |
29 } // namespace IPC | 29 } // namespace IPC |
30 | 30 |
31 namespace remoting { | 31 namespace remoting { |
32 | 32 |
33 class AudioCapturer; | 33 class AudioCapturer; |
34 class AudioPacket; | 34 class AudioPacket; |
35 class AutoThreadTaskRunner; | 35 class AutoThreadTaskRunner; |
| 36 class DesktopEnvironmentFactory; |
36 class DisconnectWindow; | 37 class DisconnectWindow; |
37 class EventExecutor; | 38 class EventExecutor; |
38 class LocalInputMonitor; | 39 class LocalInputMonitor; |
39 class RemoteInputFilter; | 40 class RemoteInputFilter; |
40 | 41 |
41 namespace protocol { | 42 namespace protocol { |
42 class InputEventTracker; | 43 class InputEventTracker; |
43 } // namespace protocol | 44 } // namespace protocol |
44 | 45 |
45 // Provides screen/audio capturing and input injection services for | 46 // Provides screen/audio capturing and input injection services for |
46 // the network process. | 47 // the network process. |
47 class DesktopSessionAgent | 48 class DesktopSessionAgent |
48 : public base::RefCountedThreadSafe<DesktopSessionAgent>, | 49 : public base::RefCountedThreadSafe<DesktopSessionAgent>, |
49 public IPC::Listener, | 50 public IPC::Listener, |
50 public MouseMoveObserver, | 51 public MouseMoveObserver, |
51 public media::ScreenCapturer::Delegate { | 52 public media::ScreenCapturer::Delegate { |
52 public: | 53 public: |
53 class Delegate { | 54 class Delegate { |
54 public: | 55 public: |
55 virtual ~Delegate(); | 56 virtual ~Delegate(); |
56 | 57 |
| 58 // Returns an instance of desktop environment factory used. |
| 59 virtual DesktopEnvironmentFactory& desktop_environment_factory() = 0; |
| 60 |
57 // Notifies the delegate that the network-to-desktop channel has been | 61 // Notifies the delegate that the network-to-desktop channel has been |
58 // disconnected. | 62 // disconnected. |
59 virtual void OnNetworkProcessDisconnected() = 0; | 63 virtual void OnNetworkProcessDisconnected() = 0; |
60 | |
61 // Request the delegate to inject Secure Attention Sequence. | |
62 virtual void InjectSas() = 0; | |
63 }; | 64 }; |
64 | 65 |
65 static scoped_refptr<DesktopSessionAgent> Create( | 66 static scoped_refptr<DesktopSessionAgent> Create( |
66 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, | 67 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, |
67 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 68 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
68 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 69 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
69 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 70 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
70 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner); | 71 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner); |
71 | 72 |
72 // IPC::Listener implementation. | 73 // IPC::Listener implementation. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 114 |
114 friend class base::RefCountedThreadSafe<DesktopSessionAgent>; | 115 friend class base::RefCountedThreadSafe<DesktopSessionAgent>; |
115 virtual ~DesktopSessionAgent(); | 116 virtual ~DesktopSessionAgent(); |
116 | 117 |
117 // Creates a connected IPC channel to be used to access the screen/audio | 118 // Creates a connected IPC channel to be used to access the screen/audio |
118 // recorders and input stubs. | 119 // recorders and input stubs. |
119 virtual bool CreateChannelForNetworkProcess( | 120 virtual bool CreateChannelForNetworkProcess( |
120 IPC::PlatformFileForTransit* client_out, | 121 IPC::PlatformFileForTransit* client_out, |
121 scoped_ptr<IPC::ChannelProxy>* server_out) = 0; | 122 scoped_ptr<IPC::ChannelProxy>* server_out) = 0; |
122 | 123 |
123 // Creates an event executor specific to the platform. | |
124 virtual scoped_ptr<EventExecutor> CreateEventExecutor() = 0; | |
125 | |
126 // Handles StartSessionAgent request from the client. | 124 // Handles StartSessionAgent request from the client. |
127 void OnStartSessionAgent(const std::string& authenticated_jid); | 125 void OnStartSessionAgent(const std::string& authenticated_jid); |
128 | 126 |
129 // Handles CaptureFrame requests from the client. | 127 // Handles CaptureFrame requests from the client. |
130 void OnCaptureFrame(); | 128 void OnCaptureFrame(); |
131 | 129 |
132 // Handles InvalidateRegion requests from the client. | 130 // Handles InvalidateRegion requests from the client. |
133 void OnInvalidateRegion(const std::vector<SkIRect>& invalid_rects); | 131 void OnInvalidateRegion(const std::vector<SkIRect>& invalid_rects); |
134 | 132 |
135 // Handles SharedBufferCreated notification from the client. | 133 // Handles SharedBufferCreated notification from the client. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 scoped_ptr<media::ScreenCapturer> video_capturer_; | 239 scoped_ptr<media::ScreenCapturer> video_capturer_; |
242 | 240 |
243 UiStrings ui_strings_; | 241 UiStrings ui_strings_; |
244 | 242 |
245 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); | 243 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); |
246 }; | 244 }; |
247 | 245 |
248 } // namespace remoting | 246 } // namespace remoting |
249 | 247 |
250 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ | 248 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
OLD | NEW |