| 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 jstring collapse_key, | 37 jstring collapse_key, |
| 38 jobjectArray data_keys_and_values); | 38 jobjectArray data_keys_and_values); |
| 39 void OnMessagesDeleted(JNIEnv* env, | 39 void OnMessagesDeleted(JNIEnv* env, |
| 40 jobject obj, | 40 jobject obj, |
| 41 jstring app_id); | 41 jstring app_id); |
| 42 | 42 |
| 43 // Register JNI methods. | 43 // Register JNI methods. |
| 44 static bool RegisterBindings(JNIEnv* env); | 44 static bool RegisterBindings(JNIEnv* env); |
| 45 | 45 |
| 46 // GCMDriver implementation: | 46 // GCMDriver implementation: |
| 47 virtual void OnSignedIn() OVERRIDE; |
| 48 virtual void Purge() OVERRIDE; |
| 47 virtual void Enable() OVERRIDE; | 49 virtual void Enable() OVERRIDE; |
| 48 virtual void Disable() OVERRIDE; | 50 virtual void Disable() OVERRIDE; |
| 49 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; | 51 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; |
| 50 virtual bool IsStarted() const OVERRIDE; | 52 virtual bool IsStarted() const OVERRIDE; |
| 51 virtual bool IsGCMClientReady() const OVERRIDE; | 53 virtual bool IsGCMClientReady() const OVERRIDE; |
| 52 virtual bool IsConnected() const OVERRIDE; | 54 virtual bool IsConnected() const OVERRIDE; |
| 53 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 55 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
| 54 bool clear_logs) OVERRIDE; | 56 bool clear_logs) OVERRIDE; |
| 55 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, | 57 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
| 56 bool recording) OVERRIDE; | 58 bool recording) OVERRIDE; |
| 57 virtual std::string SignedInUserName() const OVERRIDE; | |
| 58 | 59 |
| 59 protected: | 60 protected: |
| 60 // GCMDriver implementation: | 61 // GCMDriver implementation: |
| 61 virtual GCMClient::Result EnsureStarted() OVERRIDE; | 62 virtual GCMClient::Result EnsureStarted() OVERRIDE; |
| 62 virtual void RegisterImpl( | 63 virtual void RegisterImpl( |
| 63 const std::string& app_id, | 64 const std::string& app_id, |
| 64 const std::vector<std::string>& sender_ids) OVERRIDE; | 65 const std::vector<std::string>& sender_ids) OVERRIDE; |
| 65 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; | 66 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; |
| 66 virtual void SendImpl(const std::string& app_id, | 67 virtual void SendImpl(const std::string& app_id, |
| 67 const std::string& receiver_id, | 68 const std::string& receiver_id, |
| 68 const GCMClient::OutgoingMessage& message) OVERRIDE; | 69 const GCMClient::OutgoingMessage& message) OVERRIDE; |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 72 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 72 | 73 |
| 73 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); | 74 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 } // namespace gcm | 77 } // namespace gcm |
| 77 | 78 |
| 78 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H | 79 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H |
| OLD | NEW |