| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "components/gcm_driver/gcm_driver.h" | 13 #include "components/gcm_driver/gcm_driver.h" |
| 15 | 14 |
| 16 namespace base { | |
| 17 class FilePath; | |
| 18 class SequencedTaskRunner; | |
| 19 } | |
| 20 | |
| 21 namespace gcm { | 15 namespace gcm { |
| 22 | 16 |
| 23 // GCMDriver implementation for Android, using Android GCM APIs. | 17 // GCMDriver implementation for Android, using Android GCM APIs. |
| 24 class GCMDriverAndroid : public GCMDriver { | 18 class GCMDriverAndroid : public GCMDriver { |
| 25 public: | 19 public: |
| 26 GCMDriverAndroid( | 20 GCMDriverAndroid(); |
| 27 const base::FilePath& store_path, | |
| 28 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); | |
| 29 ~GCMDriverAndroid() override; | 21 ~GCMDriverAndroid() override; |
| 30 | 22 |
| 31 // Methods called from Java via JNI: | 23 // Methods called from Java via JNI: |
| 32 void OnRegisterFinished(JNIEnv* env, | 24 void OnRegisterFinished(JNIEnv* env, |
| 33 jobject obj, | 25 jobject obj, |
| 34 jstring app_id, | 26 jstring app_id, |
| 35 jstring registration_id, | 27 jstring registration_id, |
| 36 jboolean success); | 28 jboolean success); |
| 37 void OnUnregisterFinished(JNIEnv* env, | 29 void OnUnregisterFinished(JNIEnv* env, |
| 38 jobject obj, | 30 jobject obj, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 82 |
| 91 private: | 83 private: |
| 92 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 84 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 93 | 85 |
| 94 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); | 86 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); |
| 95 }; | 87 }; |
| 96 | 88 |
| 97 } // namespace gcm | 89 } // namespace gcm |
| 98 | 90 |
| 99 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H | 91 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H |
| OLD | NEW |