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