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

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: Addressed jianli's review comments 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 "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "components/gcm_driver/gcm_driver.h"
13
10 namespace gcm { 14 namespace gcm {
11 15
12 class GCMDriverAndroid { 16 // GCMDriver implementation for Android.
17 class GCMDriverAndroid : public GCMDriver {
13 public: 18 public:
14 // Register JNI methods 19 GCMDriverAndroid();
20 virtual ~GCMDriverAndroid();
21
22 // GCMDriver implementation:
23 virtual void Enable() OVERRIDE;
24 virtual void Disable() OVERRIDE;
25 virtual void Register(const std::string& app_id,
26 const std::vector<std::string>& sender_ids,
27 const RegisterCallback& callback) OVERRIDE;
28 virtual void Unregister(const std::string& app_id,
29 const UnregisterCallback& callback) OVERRIDE;
30 virtual void Send(const std::string& app_id,
31 const std::string& receiver_id,
32 const GCMClient::OutgoingMessage& message,
33 const SendCallback& callback) OVERRIDE;
34 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE;
35 virtual bool IsStarted() const OVERRIDE;
36 virtual bool IsGCMClientReady() const OVERRIDE;
37 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback,
38 bool clear_logs) OVERRIDE;
39 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback,
40 bool recording) OVERRIDE;
41 virtual std::string SignedInUserName() const OVERRIDE;
42
43 // Register JNI methods.
15 static bool RegisterBindings(JNIEnv* env); 44 static bool RegisterBindings(JNIEnv* env);
45
46 private:
47 DISALLOW_COPY_AND_ASSIGN(GCMDriverAndroid);
16 }; 48 };
17 49
18 } // namespace gcm 50 } // namespace gcm
19 51
20 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H 52 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_ANDROID_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698