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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 const std::string& scope, | 169 const std::string& scope, |
170 const base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher); | 170 const base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher); |
171 | 171 |
172 private: | 172 private: |
173 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); | 173 FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup); |
174 | 174 |
175 // Used as the |FetchSecretCallback| for IT2Me (or Me2Me from old webapps). | 175 // Used as the |FetchSecretCallback| for IT2Me (or Me2Me from old webapps). |
176 // Immediately calls |secret_fetched_callback| with |shared_secret|. | 176 // Immediately calls |secret_fetched_callback| with |shared_secret|. |
177 static void FetchSecretFromString( | 177 static void FetchSecretFromString( |
178 const std::string& shared_secret, | 178 const std::string& shared_secret, |
179 const protocol::SecretFetchedCallback& secret_fetched_callback); | 179 const protocol::SecretFetchedCallback& secret_fetched_callback, |
rmsousa
2013/05/23 00:14:59
Nit: The convention is to have the callback as the
Jamie
2013/05/23 01:10:08
Done.
| |
180 bool pairing_supported); | |
180 | 181 |
181 // Message handlers for messages that come from JavaScript. Called | 182 // Message handlers for messages that come from JavaScript. Called |
182 // from HandleMessage(). | 183 // from HandleMessage(). |
183 void Connect(const ClientConfig& config); | 184 void Connect(const ClientConfig& config); |
184 void Disconnect(); | 185 void Disconnect(); |
185 void OnIncomingIq(const std::string& iq); | 186 void OnIncomingIq(const std::string& iq); |
186 void ReleaseAllKeys(); | 187 void ReleaseAllKeys(); |
187 void InjectKeyEvent(const protocol::KeyEvent& event); | 188 void InjectKeyEvent(const protocol::KeyEvent& event); |
188 void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode); | 189 void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode); |
189 void TrapKey(uint32 usb_keycode, bool trap); | 190 void TrapKey(uint32 usb_keycode, bool trap); |
(...skipping 21 matching lines...) Expand all Loading... | |
211 | 212 |
212 // Returns true if the hosting content has the chrome-extension:// scheme. | 213 // Returns true if the hosting content has the chrome-extension:// scheme. |
213 bool IsCallerAppOrExtension(); | 214 bool IsCallerAppOrExtension(); |
214 | 215 |
215 // Returns true if there is a ConnectionToHost and it is connected. | 216 // Returns true if there is a ConnectionToHost and it is connected. |
216 bool IsConnected(); | 217 bool IsConnected(); |
217 | 218 |
218 // Used as the |FetchSecretCallback| for Me2Me connections. | 219 // Used as the |FetchSecretCallback| for Me2Me connections. |
219 // Uses the PIN request dialog in the webapp to obtain the shared secret. | 220 // Uses the PIN request dialog in the webapp to obtain the shared secret. |
220 void FetchSecretFromDialog( | 221 void FetchSecretFromDialog( |
221 const protocol::SecretFetchedCallback& secret_fetched_callback); | 222 const protocol::SecretFetchedCallback& secret_fetched_callback, |
223 bool pairing_supported); | |
222 | 224 |
223 bool initialized_; | 225 bool initialized_; |
224 | 226 |
225 PepperPluginThreadDelegate plugin_thread_delegate_; | 227 PepperPluginThreadDelegate plugin_thread_delegate_; |
226 scoped_refptr<PluginThreadTaskRunner> plugin_task_runner_; | 228 scoped_refptr<PluginThreadTaskRunner> plugin_task_runner_; |
227 ClientContext context_; | 229 ClientContext context_; |
228 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; | 230 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; |
229 scoped_ptr<PepperView> view_; | 231 scoped_ptr<PepperView> view_; |
230 pp::View plugin_view_; | 232 pp::View plugin_view_; |
231 | 233 |
(...skipping 22 matching lines...) Expand all Loading... | |
254 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher_; | 256 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher_; |
255 | 257 |
256 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 258 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
257 | 259 |
258 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 260 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
259 }; | 261 }; |
260 | 262 |
261 } // namespace remoting | 263 } // namespace remoting |
262 | 264 |
263 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 265 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
OLD | NEW |