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

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

Issue 2542083004: Make //blimp/client/app a real embedder of //blimp/client/public (Closed)
Patch Set: Fix findbugs issue Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
6 #define BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
7
8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h"
10 #include "base/android/scoped_java_ref.h"
11 #include "base/macros.h"
12 #include "blimp/client/app/session/blimp_client_session.h"
13 #include "blimp/client/core/contents/android/ime_helper_dialog.h"
14 #include "blimp/client/public/session/assignment.h"
15
16 namespace blimp {
17 namespace client {
18
19 class BlimpClientSessionAndroid : public BlimpClientSession {
20 public:
21 static bool RegisterJni(JNIEnv* env);
22 static BlimpClientSessionAndroid* FromJavaObject(
23 JNIEnv* env,
24 const base::android::JavaRef<jobject>& jobj);
25
26 BlimpClientSessionAndroid(
27 JNIEnv* env,
28 const base::android::JavaParamRef<jobject>& jobj,
29 const base::android::JavaParamRef<jstring>& jassigner_url,
30 jlong window_android_ptr);
31
32 // Methods called from Java via JNI.
33 // |jclient_auth_token| is an OAuth2 access token created by GoogleAuthUtil.
34 // See BlimpClientSession::Connect() for more information.
35 void Connect(JNIEnv* env,
36 const base::android::JavaParamRef<jobject>& jobj,
37 const base::android::JavaParamRef<jstring>& jclient_auth_token);
38
39 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& jobj);
40
41 // Returns an integer array to Java representing blimp debug statistics which
42 // contain bytes received, bytes sent, number of commits in order.
43 base::android::ScopedJavaLocalRef<jintArray> GetDebugInfo(
44 JNIEnv* env,
45 const base::android::JavaParamRef<jobject>& jobj);
46
47 private:
48 ~BlimpClientSessionAndroid() override;
49
50 // BlimpClientSession implementation.
51 void OnAssignmentConnectionAttempted(AssignmentRequestResult result,
52 const Assignment& assignment) override;
53
54 // NetworkEventObserver implementation.
55 void OnConnected() override;
56 void OnDisconnected(int error_code) override;
57
58 // Helper class for text input.
59 std::unique_ptr<ImeHelperDialog> ime_dialog_;
60
61 // Reference to the Java object which owns this class.
62 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
63
64 DISALLOW_COPY_AND_ASSIGN(BlimpClientSessionAndroid);
65 };
66
67 } // namespace client
68 } // namespace blimp
69
70 #endif // BLIMP_CLIENT_APP_ANDROID_BLIMP_CLIENT_SESSION_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698