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

Side by Side 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: Rebase, and add FakeGCMDriver for unit tests Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "components/gcm_driver/gcm_driver.h"
11
10 namespace gcm { 12 namespace gcm {
11 13
12 class GCMDriverAndroid { 14 // GCMDriver implementation for Android.
15 class GCMDriverAndroid : public GCMDriver {
13 public: 16 public:
14 // Register JNI methods 17 GCMDriverAndroid();
18 virtual ~GCMDriverAndroid();
19
20 // GCMDriver implementation:
21 virtual void Enable() OVERRIDE;
22 virtual void Disable() OVERRIDE;
23 virtual void Register(const std::string& app_id,
24 const std::vector<std::string>& sender_ids,
25 const RegisterCallback& callback) OVERRIDE;
26 virtual void Unregister(const std::string& app_id,
27 const UnregisterCallback& callback) OVERRIDE;
28 virtual void Send(const std::string& app_id,
29 const std::string& receiver_id,
30 const GCMClient::OutgoingMessage& message,
31 const SendCallback& callback) OVERRIDE;
32 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
33 virtual bool IsStarted() const OVERRIDE;
34 virtual bool IsGCMClientReady() const OVERRIDE;
35 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
36 bool clear_logs) OVERRIDE;
37 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
38 bool recording) OVERRIDE;
39 virtual std::string SignedInUserName() const OVERRIDE;
40
41 // Register JNI methods.
15 static bool RegisterBindings(JNIEnv* env); 42 static bool RegisterBindings(JNIEnv* env);
16 }; 43 };
17 44
18 } // namespace gcm 45 } // namespace gcm
19 46
20 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H 47 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698