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 // TODO(ajwong): We need to come up with a better description of the | 5 // TODO(ajwong): We need to come up with a better description of the |
6 // responsibilities for each thread. | 6 // responsibilities for each thread. |
7 | 7 |
8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 virtual void HandleMessage(const pp::Var& message) OVERRIDE; | 113 virtual void HandleMessage(const pp::Var& message) OVERRIDE; |
114 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; | 114 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; |
115 | 115 |
116 // ClientUserInterface interface. | 116 // ClientUserInterface interface. |
117 virtual void OnConnectionState(protocol::ConnectionToHost::State state, | 117 virtual void OnConnectionState(protocol::ConnectionToHost::State state, |
118 protocol::ErrorCode error) OVERRIDE; | 118 protocol::ErrorCode error) OVERRIDE; |
119 virtual void OnConnectionReady(bool ready) OVERRIDE; | 119 virtual void OnConnectionReady(bool ready) OVERRIDE; |
120 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; | 120 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; |
121 virtual void SetPairingResponse( | 121 virtual void SetPairingResponse( |
122 const protocol::PairingResponse& pairing_response) OVERRIDE; | 122 const protocol::PairingResponse& pairing_response) OVERRIDE; |
| 123 virtual void DeliverHostMessage( |
| 124 const protocol::ExtensionMessage& message) OVERRIDE; |
123 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; | 125 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; |
124 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; | 126 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; |
125 virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | 127 virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
126 GetTokenFetcher(const std::string& host_public_key) OVERRIDE; | 128 GetTokenFetcher(const std::string& host_public_key) OVERRIDE; |
127 | 129 |
128 // protocol::ClipboardStub interface. | 130 // protocol::ClipboardStub interface. |
129 virtual void InjectClipboardEvent( | 131 virtual void InjectClipboardEvent( |
130 const protocol::ClipboardEvent& event) OVERRIDE; | 132 const protocol::ClipboardEvent& event) OVERRIDE; |
131 | 133 |
132 // protocol::CursorShapeStub interface. | 134 // protocol::CursorShapeStub interface. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode); | 193 void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode); |
192 void TrapKey(uint32 usb_keycode, bool trap); | 194 void TrapKey(uint32 usb_keycode, bool trap); |
193 void SendClipboardItem(const std::string& mime_type, const std::string& item); | 195 void SendClipboardItem(const std::string& mime_type, const std::string& item); |
194 void NotifyClientResolution(int width, int height, int x_dpi, int y_dpi); | 196 void NotifyClientResolution(int width, int height, int x_dpi, int y_dpi); |
195 void PauseVideo(bool pause); | 197 void PauseVideo(bool pause); |
196 void PauseAudio(bool pause); | 198 void PauseAudio(bool pause); |
197 void OnPinFetched(const std::string& pin); | 199 void OnPinFetched(const std::string& pin); |
198 void OnThirdPartyTokenFetched(const std::string& token, | 200 void OnThirdPartyTokenFetched(const std::string& token, |
199 const std::string& shared_secret); | 201 const std::string& shared_secret); |
200 void RequestPairing(const std::string& client_name); | 202 void RequestPairing(const std::string& client_name); |
| 203 void SendClientMessage(const std::string& type, const std::string& data); |
201 | 204 |
202 // Helper method to post messages to the webapp. | 205 // Helper method to post messages to the webapp. |
203 void PostChromotingMessage(const std::string& method, | 206 void PostChromotingMessage(const std::string& method, |
204 scoped_ptr<base::DictionaryValue> data); | 207 scoped_ptr<base::DictionaryValue> data); |
205 | 208 |
206 // Posts trapped keys to the web-app to handle. | 209 // Posts trapped keys to the web-app to handle. |
207 void SendTrappedKey(uint32 usb_keycode, bool pressed); | 210 void SendTrappedKey(uint32 usb_keycode, bool pressed); |
208 | 211 |
209 // Callback for PepperSignalStrategy. | 212 // Callback for PepperSignalStrategy. |
210 void SendOutgoingIq(const std::string& iq); | 213 void SendOutgoingIq(const std::string& iq); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 262 |
260 // Weak reference to this instance, used for global logging and task posting. | 263 // Weak reference to this instance, used for global logging and task posting. |
261 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 264 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
262 | 265 |
263 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 266 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
264 }; | 267 }; |
265 | 268 |
266 } // namespace remoting | 269 } // namespace remoting |
267 | 270 |
268 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 271 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
OLD | NEW |