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

Unified Diff: components/gcm_driver/gcm_driver_android.h

Issue 278493002: Split GCMDriver into platform-specific implementations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
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 653a4f23a868b9970f158a0fea6bb32be78a68b4..0d0e8768016a4add003d77e2aed8a034eba8d76d 100644
--- a/components/gcm_driver/gcm_driver_android.h
+++ b/components/gcm_driver/gcm_driver_android.h
@@ -7,14 +7,46 @@
#include <jni.h>
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "components/gcm_driver/gcm_driver.h"
+
namespace gcm {
-class GCMDriverAndroid {
+// GCMDriver implementation for Android.
+class GCMDriverAndroid : public GCMDriver {
public:
- // Register JNI methods
+ GCMDriverAndroid();
+ virtual ~GCMDriverAndroid();
+
+ // GCMDriver implementation:
+ virtual void Enable() OVERRIDE;
+ virtual void Disable() OVERRIDE;
+ virtual void Register(const std::string& app_id,
+ const std::vector<std::string>& sender_ids,
+ const RegisterCallback& callback) OVERRIDE;
+ virtual void Unregister(const std::string& app_id,
+ const UnregisterCallback& callback) OVERRIDE;
+ virtual void Send(const std::string& app_id,
+ const std::string& receiver_id,
+ const GCMClient::OutgoingMessage& message,
+ const SendCallback& callback) OVERRIDE;
+ virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
+ virtual bool IsStarted() const OVERRIDE;
+ virtual bool IsGCMClientReady() const OVERRIDE;
+ virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
+ bool clear_logs) OVERRIDE;
+ virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
+ bool recording) OVERRIDE;
+ virtual std::string SignedInUserName() const OVERRIDE;
+
+ // Register JNI methods.
static bool RegisterBindings(JNIEnv* env);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid);
};
} // namespace gcm
-#endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H
+#endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H

Powered by Google App Engine
This is Rietveld 408576698