| 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 |
| 11 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "remoting/base/auto_thread.h" | 14 #include "remoting/base/auto_thread.h" |
| 14 #include "remoting/client/jni/chromoting_jni_instance.h" | 15 #include "remoting/client/jni/chromoting_jni_instance.h" |
| 15 #include "remoting/protocol/connection_to_host.h" | 16 #include "remoting/protocol/connection_to_host.h" |
| 16 | 17 |
| 17 template<typename T> struct DefaultSingletonTraits; | 18 template<typename T> struct DefaultSingletonTraits; |
| 18 | 19 |
| 19 namespace remoting { | 20 namespace remoting { |
| 20 | 21 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 protocol::ErrorCode error); | 73 protocol::ErrorCode error); |
| 73 | 74 |
| 74 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread. | 75 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread. |
| 75 void DisplayAuthenticationPrompt(bool pairing_supported); | 76 void DisplayAuthenticationPrompt(bool pairing_supported); |
| 76 | 77 |
| 77 // Saves new pairing credentials to permanent storage. Call on UI thread. | 78 // Saves new pairing credentials to permanent storage. Call on UI thread. |
| 78 void CommitPairingCredentials(const std::string& host, | 79 void CommitPairingCredentials(const std::string& host, |
| 79 const std::string& id, | 80 const std::string& id, |
| 80 const std::string& secret); | 81 const std::string& secret); |
| 81 | 82 |
| 82 // Updates image dimensions and canvas memory space. Call on display thread. | 83 // Creates a new Bitmap object to store a video frame. |
| 83 void UpdateImageBuffer(int width, int height, jobject buffer); | 84 base::android::ScopedJavaLocalRef<jobject> NewBitmap( |
| 85 webrtc::DesktopSize size); |
| 86 |
| 87 // Updates video frame bitmap. |bitmap| must be an instance of |
| 88 // android.graphics.Bitmap. Call on the display thread. |
| 89 void UpdateFrameBitmap(jobject bitmap); |
| 84 | 90 |
| 85 // Updates cursor shape. Call on display thread. | 91 // Updates cursor shape. Call on display thread. |
| 86 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); | 92 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |
| 87 | 93 |
| 88 // Draws the latest image buffer onto the canvas. Call on the display thread. | 94 // Draws the latest image buffer onto the canvas. Call on the display thread. |
| 89 void RedrawCanvas(); | 95 void RedrawCanvas(); |
| 90 | 96 |
| 91 private: | 97 private: |
| 92 ChromotingJniRuntime(); | 98 ChromotingJniRuntime(); |
| 93 | 99 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 122 scoped_refptr<ChromotingJniInstance> session_; | 128 scoped_refptr<ChromotingJniInstance> session_; |
| 123 | 129 |
| 124 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; | 130 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; |
| 125 | 131 |
| 126 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); | 132 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); |
| 127 }; | 133 }; |
| 128 | 134 |
| 129 } // namespace remoting | 135 } // namespace remoting |
| 130 | 136 |
| 131 #endif | 137 #endif |
| OLD | NEW |