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_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
6 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 6 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // interface. Should be updated whenever we remove support for | 97 // interface. Should be updated whenever we remove support for |
98 // an older version of the API. | 98 // an older version of the API. |
99 static const int kApiMinMessagingVersion = 5; | 99 static const int kApiMinMessagingVersion = 5; |
100 | 100 |
101 // Backward-compatibility version used by for the ScriptableObject | 101 // Backward-compatibility version used by for the ScriptableObject |
102 // interface. Should be updated whenever we remove support for | 102 // interface. Should be updated whenever we remove support for |
103 // an older version of the API. | 103 // an older version of the API. |
104 static const int kApiMinScriptableVersion = 5; | 104 static const int kApiMinScriptableVersion = 5; |
105 | 105 |
106 explicit ChromotingInstance(PP_Instance instance); | 106 explicit ChromotingInstance(PP_Instance instance); |
107 virtual ~ChromotingInstance(); | 107 ~ChromotingInstance() override; |
108 | 108 |
109 // pp::Instance interface. | 109 // pp::Instance interface. |
110 virtual void DidChangeFocus(bool has_focus) override; | 110 void DidChangeFocus(bool has_focus) override; |
111 virtual void DidChangeView(const pp::View& view) override; | 111 void DidChangeView(const pp::View& view) override; |
112 virtual bool Init(uint32_t argc, const char* argn[], | 112 bool Init(uint32_t argc, const char* argn[], const char* argv[]) override; |
113 const char* argv[]) override; | 113 void HandleMessage(const pp::Var& message) override; |
114 virtual void HandleMessage(const pp::Var& message) override; | 114 bool HandleInputEvent(const pp::InputEvent& event) override; |
115 virtual bool HandleInputEvent(const pp::InputEvent& event) override; | |
116 | 115 |
117 // ClientUserInterface interface. | 116 // ClientUserInterface interface. |
118 virtual void OnConnectionState(protocol::ConnectionToHost::State state, | 117 void OnConnectionState(protocol::ConnectionToHost::State state, |
119 protocol::ErrorCode error) override; | 118 protocol::ErrorCode error) override; |
120 virtual void OnConnectionReady(bool ready) override; | 119 void OnConnectionReady(bool ready) override; |
121 virtual void OnRouteChanged(const std::string& channel_name, | 120 void OnRouteChanged(const std::string& channel_name, |
122 const protocol::TransportRoute& route) override; | 121 const protocol::TransportRoute& route) override; |
123 virtual void SetCapabilities(const std::string& capabilities) override; | 122 void SetCapabilities(const std::string& capabilities) override; |
124 virtual void SetPairingResponse( | 123 void SetPairingResponse( |
125 const protocol::PairingResponse& pairing_response) override; | 124 const protocol::PairingResponse& pairing_response) override; |
126 virtual void DeliverHostMessage( | 125 void DeliverHostMessage(const protocol::ExtensionMessage& message) override; |
127 const protocol::ExtensionMessage& message) override; | 126 protocol::ClipboardStub* GetClipboardStub() override; |
128 virtual protocol::ClipboardStub* GetClipboardStub() override; | 127 protocol::CursorShapeStub* GetCursorShapeStub() override; |
129 virtual protocol::CursorShapeStub* GetCursorShapeStub() override; | |
130 | 128 |
131 // protocol::ClipboardStub interface. | 129 // protocol::ClipboardStub interface. |
132 virtual void InjectClipboardEvent( | 130 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; |
133 const protocol::ClipboardEvent& event) override; | |
134 | 131 |
135 // protocol::CursorShapeStub interface. | 132 // protocol::CursorShapeStub interface. |
136 virtual void SetCursorShape( | 133 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; |
137 const protocol::CursorShapeInfo& cursor_shape) override; | |
138 | 134 |
139 // Called by PepperView. | 135 // Called by PepperView. |
140 void SetDesktopSize(const webrtc::DesktopSize& size, | 136 void SetDesktopSize(const webrtc::DesktopSize& size, |
141 const webrtc::DesktopVector& dpi); | 137 const webrtc::DesktopVector& dpi); |
142 void SetDesktopShape(const webrtc::DesktopRegion& shape); | 138 void SetDesktopShape(const webrtc::DesktopRegion& shape); |
143 void OnFirstFrameReceived(); | 139 void OnFirstFrameReceived(); |
144 | 140 |
145 // Return statistics record by ChromotingClient. | 141 // Return statistics record by ChromotingClient. |
146 // If no connection is currently active then NULL will be returned. | 142 // If no connection is currently active then NULL will be returned. |
147 ChromotingStats* GetStats(); | 143 ChromotingStats* GetStats(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Returns true if there is a ConnectionToHost and it is connected. | 233 // Returns true if there is a ConnectionToHost and it is connected. |
238 bool IsConnected(); | 234 bool IsConnected(); |
239 | 235 |
240 // Used as the |FetchSecretCallback| for Me2Me connections. | 236 // Used as the |FetchSecretCallback| for Me2Me connections. |
241 // Uses the PIN request dialog in the webapp to obtain the shared secret. | 237 // Uses the PIN request dialog in the webapp to obtain the shared secret. |
242 void FetchSecretFromDialog( | 238 void FetchSecretFromDialog( |
243 bool pairing_supported, | 239 bool pairing_supported, |
244 const protocol::SecretFetchedCallback& secret_fetched_callback); | 240 const protocol::SecretFetchedCallback& secret_fetched_callback); |
245 | 241 |
246 // MediaSourceVideoRenderer::Delegate implementation. | 242 // MediaSourceVideoRenderer::Delegate implementation. |
247 virtual void OnMediaSourceSize(const webrtc::DesktopSize& size, | 243 void OnMediaSourceSize(const webrtc::DesktopSize& size, |
248 const webrtc::DesktopVector& dpi) override; | 244 const webrtc::DesktopVector& dpi) override; |
249 virtual void OnMediaSourceShape(const webrtc::DesktopRegion& shape) override; | 245 void OnMediaSourceShape(const webrtc::DesktopRegion& shape) override; |
250 virtual void OnMediaSourceReset(const std::string& format) override; | 246 void OnMediaSourceReset(const std::string& format) override; |
251 virtual void OnMediaSourceData(uint8_t* buffer, size_t buffer_size, | 247 void OnMediaSourceData(uint8_t* buffer, |
252 bool keyframe) override; | 248 size_t buffer_size, |
| 249 bool keyframe) override; |
253 | 250 |
254 bool initialized_; | 251 bool initialized_; |
255 | 252 |
256 PepperPluginThreadDelegate plugin_thread_delegate_; | 253 PepperPluginThreadDelegate plugin_thread_delegate_; |
257 scoped_refptr<PluginThreadTaskRunner> plugin_task_runner_; | 254 scoped_refptr<PluginThreadTaskRunner> plugin_task_runner_; |
258 scoped_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_; | 255 scoped_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_; |
259 scoped_ptr<jingle_glue::JingleThreadWrapper> thread_wrapper_; | 256 scoped_ptr<jingle_glue::JingleThreadWrapper> thread_wrapper_; |
260 ClientContext context_; | 257 ClientContext context_; |
261 scoped_ptr<VideoRenderer> video_renderer_; | 258 scoped_ptr<VideoRenderer> video_renderer_; |
262 scoped_ptr<PepperView> view_; | 259 scoped_ptr<PepperView> view_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 294 |
298 // Weak reference to this instance, used for global logging and task posting. | 295 // Weak reference to this instance, used for global logging and task posting. |
299 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 296 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
300 | 297 |
301 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 298 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
302 }; | 299 }; |
303 | 300 |
304 } // namespace remoting | 301 } // namespace remoting |
305 | 302 |
306 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 303 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
OLD | NEW |