| 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; | 47 virtual void OnSignedIn() override; |
| 48 virtual void Purge() OVERRIDE; | 48 virtual void Purge() override; |
| 49 virtual void Enable() OVERRIDE; | 49 virtual void Enable() override; |
| 50 virtual void AddConnectionObserver(GCMConnectionObserver* observer) OVERRIDE; | 50 virtual void AddConnectionObserver(GCMConnectionObserver* observer) override; |
| 51 virtual void RemoveConnectionObserver( | 51 virtual void RemoveConnectionObserver( |
| 52 GCMConnectionObserver* observer) OVERRIDE; | 52 GCMConnectionObserver* observer) override; |
| 53 virtual void Disable() OVERRIDE; | 53 virtual void Disable() override; |
| 54 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; | 54 virtual GCMClient* GetGCMClientForTesting() const override; |
| 55 virtual bool IsStarted() const OVERRIDE; | 55 virtual bool IsStarted() const override; |
| 56 virtual bool IsConnected() const OVERRIDE; | 56 virtual bool IsConnected() const override; |
| 57 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 57 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
| 58 bool clear_logs) OVERRIDE; | 58 bool clear_logs) override; |
| 59 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, | 59 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
| 60 bool recording) OVERRIDE; | 60 bool recording) override; |
| 61 virtual void SetAccountTokens( | 61 virtual void SetAccountTokens( |
| 62 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) OVERRIDE; | 62 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) override; |
| 63 virtual void UpdateAccountMapping( | 63 virtual void UpdateAccountMapping( |
| 64 const AccountMapping& account_mapping) OVERRIDE; | 64 const AccountMapping& account_mapping) override; |
| 65 virtual void RemoveAccountMapping(const std::string& account_id) OVERRIDE; | 65 virtual void RemoveAccountMapping(const std::string& account_id) override; |
| 66 | 66 |
| 67 protected: | 67 protected: |
| 68 // GCMDriver implementation: | 68 // GCMDriver implementation: |
| 69 virtual GCMClient::Result EnsureStarted() OVERRIDE; | 69 virtual GCMClient::Result EnsureStarted() override; |
| 70 virtual void RegisterImpl( | 70 virtual void RegisterImpl( |
| 71 const std::string& app_id, | 71 const std::string& app_id, |
| 72 const std::vector<std::string>& sender_ids) OVERRIDE; | 72 const std::vector<std::string>& sender_ids) override; |
| 73 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; | 73 virtual void UnregisterImpl(const std::string& app_id) override; |
| 74 virtual void SendImpl(const std::string& app_id, | 74 virtual void SendImpl(const std::string& app_id, |
| 75 const std::string& receiver_id, | 75 const std::string& receiver_id, |
| 76 const GCMClient::OutgoingMessage& message) OVERRIDE; | 76 const GCMClient::OutgoingMessage& message) override; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 79 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); | 81 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace gcm | 84 } // namespace gcm |
| 85 | 85 |
| 86 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H | 86 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H |
| OLD | NEW |