Chromium Code Reviews| Index: components/gcm_driver/gcm_driver_android.h |
| diff --git a/components/gcm_driver/gcm_driver_android.h b/components/gcm_driver/gcm_driver_android.h |
| index 0d0e8768016a4add003d77e2aed8a034eba8d76d..998a858db158b736e1d02910949fa11b99eb25d8 100644 |
| --- a/components/gcm_driver/gcm_driver_android.h |
| +++ b/components/gcm_driver/gcm_driver_android.h |
| @@ -7,13 +7,14 @@ |
| #include <jni.h> |
| +#include "base/android/scoped_java_ref.h" |
| #include "base/compiler_specific.h" |
| #include "base/macros.h" |
| #include "components/gcm_driver/gcm_driver.h" |
| namespace gcm { |
| -// GCMDriver implementation for Android. |
| +// GCMDriver implementation for Android, using Android GCM APIs. |
| class GCMDriverAndroid : public GCMDriver { |
| public: |
| GCMDriverAndroid(); |
| @@ -40,10 +41,32 @@ class GCMDriverAndroid : public GCMDriver { |
| bool recording) OVERRIDE; |
| virtual std::string SignedInUserName() const OVERRIDE; |
| + // Methods called from Java via JNI: |
| + void OnRegisterFinished(JNIEnv* env, |
| + jobject obj, |
| + jstring app_id, |
| + jstring registration_id, |
| + jboolean success); |
| + void OnUnregisterFinished(JNIEnv* env, |
| + jobject obj, |
| + jstring app_id, |
| + jboolean success); |
| + void OnMessageReceived(JNIEnv* env, |
| + jobject obj, |
| + jstring app_id, |
| + jstring sender_id, |
| + jstring collapse_key, |
| + jobjectArray data_keys_and_values); |
| + void OnMessagesDeletedByServer(JNIEnv* env, |
|
fgorski
2014/06/03 17:38:25
OnMessagesDeleted for consistency.
johnme
2014/06/03 17:50:37
Done.
|
| + jobject obj, |
| + jstring app_id); |
| + |
| // Register JNI methods. |
| static bool RegisterBindings(JNIEnv* env); |
| private: |
| + base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); |
| }; |