Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: blimp/client/app/android/blimp_client_session_android.h

Issue 2292343002: Hooking up Blimp IME with BlimpContents (Closed)
Patch Set: Fixed linux client Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_ 5 #ifndef BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_ 6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "blimp/client/core/contents/android/ime_helper_dialog.h"
11 #include "blimp/client/public/session/assignment.h" 12 #include "blimp/client/public/session/assignment.h"
12 #include "blimp/client/session/blimp_client_session.h" 13 #include "blimp/client/session/blimp_client_session.h"
13 14
14 namespace blimp { 15 namespace blimp {
15 namespace client { 16 namespace client {
16 17
17 class AssignmentSource; 18 class AssignmentSource;
18 19
19 class BlimpClientSessionAndroid : public BlimpClientSession { 20 class BlimpClientSessionAndroid : public BlimpClientSession {
20 public: 21 public:
21 static bool RegisterJni(JNIEnv* env); 22 static bool RegisterJni(JNIEnv* env);
22 static BlimpClientSessionAndroid* FromJavaObject(JNIEnv* env, jobject jobj); 23 static BlimpClientSessionAndroid* FromJavaObject(JNIEnv* env, jobject jobj);
23 24
24 BlimpClientSessionAndroid( 25 BlimpClientSessionAndroid(
25 JNIEnv* env, 26 JNIEnv* env,
26 const base::android::JavaParamRef<jobject>& jobj, 27 const base::android::JavaParamRef<jobject>& jobj,
27 const base::android::JavaParamRef<jstring>& jassigner_url); 28 const base::android::JavaParamRef<jstring>& jassigner_url,
29 jlong window_android_ptr);
28 30
29 // Methods called from Java via JNI. 31 // Methods called from Java via JNI.
30 // |jclient_auth_token| is an OAuth2 access token created by GoogleAuthUtil. 32 // |jclient_auth_token| is an OAuth2 access token created by GoogleAuthUtil.
31 // See BlimpClientSession::Connect() for more information. 33 // See BlimpClientSession::Connect() for more information.
32 void Connect(JNIEnv* env, 34 void Connect(JNIEnv* env,
33 const base::android::JavaParamRef<jobject>& jobj, 35 const base::android::JavaParamRef<jobject>& jobj,
34 const base::android::JavaParamRef<jstring>& jclient_auth_token); 36 const base::android::JavaParamRef<jstring>& jclient_auth_token);
35 37
36 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj); 38 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
37 39
38 // Returns an integer array to Java representing blimp debug statistics which 40 // Returns an integer array to Java representing blimp debug statistics which
39 // contain bytes received, bytes sent, number of commits in order. 41 // contain bytes received, bytes sent, number of commits in order.
40 base::android::ScopedJavaLocalRef<jintArray> GetDebugInfo( 42 base::android::ScopedJavaLocalRef<jintArray> GetDebugInfo(
41 JNIEnv* env, 43 JNIEnv* env,
42 const base::android::JavaParamRef<jobject>& jobj); 44 const base::android::JavaParamRef<jobject>& jobj);
43 45
44 private: 46 private:
45 ~BlimpClientSessionAndroid() override; 47 ~BlimpClientSessionAndroid() override;
46 48
47 // BlimpClientSession implementation. 49 // BlimpClientSession implementation.
48 void OnAssignmentConnectionAttempted(AssignmentRequestResult result, 50 void OnAssignmentConnectionAttempted(AssignmentRequestResult result,
49 const Assignment& assignment) override; 51 const Assignment& assignment) override;
50 52
51 // NetworkEventObserver implementation. 53 // NetworkEventObserver implementation.
52 void OnConnected() override; 54 void OnConnected() override;
53 void OnDisconnected(int error_code) override; 55 void OnDisconnected(int error_code) override;
54 56
57 // Helper class for text input.
58 std::unique_ptr<ImeHelperDialog> ime_dialog_;
59
55 // Reference to the Java object which owns this class. 60 // Reference to the Java object which owns this class.
56 base::android::ScopedJavaGlobalRef<jobject> java_obj_; 61 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
57 62
58 DISALLOW_COPY_AND_ASSIGN(BlimpClientSessionAndroid); 63 DISALLOW_COPY_AND_ASSIGN(BlimpClientSessionAndroid);
59 }; 64 };
60 65
61 } // namespace client 66 } // namespace client
62 } // namespace blimp 67 } // namespace blimp
63 68
64 #endif // BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_ 69 #endif // BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
OLDNEW
« no previous file with comments | « blimp/client/app/android/blimp_app_jni_registrar.cc ('k') | blimp/client/app/android/blimp_client_session_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698