| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_JNI_CHROMOTING_JNI_RUNTIME_H_ | 5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
| 6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ | 6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Initiates a connection with the specified host. Only call when a host | 50 // Initiates a connection with the specified host. Only call when a host |
| 51 // connection is active (i.e. between a call to Connect() and the | 51 // connection is active (i.e. between a call to Connect() and the |
| 52 // corresponding call to Disconnect()). To skip the attempt at pair-based | 52 // corresponding call to Disconnect()). To skip the attempt at pair-based |
| 53 // authentication, leave |pairing_id| and |pairing_secret| as empty strings. | 53 // authentication, leave |pairing_id| and |pairing_secret| as empty strings. |
| 54 void ConnectToHost(const char* username, | 54 void ConnectToHost(const char* username, |
| 55 const char* auth_token, | 55 const char* auth_token, |
| 56 const char* host_jid, | 56 const char* host_jid, |
| 57 const char* host_id, | 57 const char* host_id, |
| 58 const char* host_pubkey, | 58 const char* host_pubkey, |
| 59 const char* pairing_id, | 59 const char* pairing_id, |
| 60 const char* pairing_secret); | 60 const char* pairing_secret, |
| 61 const char* capabilities); |
| 61 | 62 |
| 62 // Terminates any ongoing connection attempt and cleans up by nullifying | 63 // Terminates any ongoing connection attempt and cleans up by nullifying |
| 63 // |session_|. This is a no-op unless |session| is currently non-null. | 64 // |session_|. This is a no-op unless |session| is currently non-null. |
| 64 void DisconnectFromHost(); | 65 void DisconnectFromHost(); |
| 65 | 66 |
| 66 // Returns the client for the currently-active session. Do not call if | 67 // Returns the client for the currently-active session. Do not call if |
| 67 // |session| is null. | 68 // |session| is null. |
| 68 scoped_refptr<ChromotingJniInstance> session() { | 69 scoped_refptr<ChromotingJniInstance> session() { |
| 69 DCHECK(session_); | 70 DCHECK(session_); |
| 70 return session_; | 71 return session_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 81 void CommitPairingCredentials(const std::string& host, | 82 void CommitPairingCredentials(const std::string& host, |
| 82 const std::string& id, | 83 const std::string& id, |
| 83 const std::string& secret); | 84 const std::string& secret); |
| 84 | 85 |
| 85 // Pops up a third party login page to fetch token required for | 86 // Pops up a third party login page to fetch token required for |
| 86 // authentication. Call on UI thread. | 87 // authentication. Call on UI thread. |
| 87 void FetchThirdPartyToken(const GURL& token_url, | 88 void FetchThirdPartyToken(const GURL& token_url, |
| 88 const std::string& client_id, | 89 const std::string& client_id, |
| 89 const std::string& scope); | 90 const std::string& scope); |
| 90 | 91 |
| 92 // Pass on the set of negotiated capabilities to the client. |
| 93 void SetCapabilities(const std::string& capabilities); |
| 94 |
| 95 // Passes on the deconstructed ExtensionMessage to the client to handle |
| 96 // appropriately. |
| 97 void HandleExtensionMessage(const std::string& type, |
| 98 const std::string& message); |
| 99 |
| 91 // Creates a new Bitmap object to store a video frame. | 100 // Creates a new Bitmap object to store a video frame. |
| 92 base::android::ScopedJavaLocalRef<jobject> NewBitmap( | 101 base::android::ScopedJavaLocalRef<jobject> NewBitmap( |
| 93 webrtc::DesktopSize size); | 102 webrtc::DesktopSize size); |
| 94 | 103 |
| 95 // Updates video frame bitmap. |bitmap| must be an instance of | 104 // Updates video frame bitmap. |bitmap| must be an instance of |
| 96 // android.graphics.Bitmap. Call on the display thread. | 105 // android.graphics.Bitmap. Call on the display thread. |
| 97 void UpdateFrameBitmap(jobject bitmap); | 106 void UpdateFrameBitmap(jobject bitmap); |
| 98 | 107 |
| 99 // Updates cursor shape. Call on display thread. | 108 // Updates cursor shape. Call on display thread. |
| 100 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); | 109 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 scoped_refptr<ChromotingJniInstance> session_; | 142 scoped_refptr<ChromotingJniInstance> session_; |
| 134 | 143 |
| 135 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; | 144 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; |
| 136 | 145 |
| 137 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); | 146 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); |
| 138 }; | 147 }; |
| 139 | 148 |
| 140 } // namespace remoting | 149 } // namespace remoting |
| 141 | 150 |
| 142 #endif | 151 #endif |
| OLD | NEW |