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

Side by Side Diff: chrome/browser/android/gcm_android.h

Issue 237323002: [NOT FOR REVIEW] Plumb Android GCM to Push API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/gcm_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_GCM_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_GCM_ANDROID_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/android/jni_android.h"
12 #include "base/android/scoped_java_ref.h"
13 //#include "base/callback.h"
14 #include "base/memory/singleton.h"
15 #include "content/public/browser/push_messaging_service.h"
16
17 namespace content{
18 class PushMessagingMessageFilter;
19 }
20
21 class GcmPlatformImplAndroid : public content::PushMessagingService {
22 public:
23 // Initiates registration with GCM. No caching of registrations is done,
24 // except any provided by the underlying GoogleCloudMessaging API.
25 void Register(
26 const std::string& app_unique_id_currently_ignored,
27 const std::vector<std::string>& sender_ids,
28 const content::PushMessagingService::RegisterCallback& callback) OVERRIDE;
29 // Not yet implemented.
30 //void UnregisterApp(const std::string& app_unique_id_currently_ignored);
31
32 void SetObserver(content::PushMessagingMessageFilter* observer);
33
34 // Methods called from Java via JNI.
35 void OnRegistrationFinished(JNIEnv* env, jobject obj, jstring data);
36 void OnMessageReceived(JNIEnv* env, jobject obj, jstring data);
37 void OnMessagesDeletedByServer(JNIEnv* env, jobject obj);
38
39 // Static functions.
40 static GcmPlatformImplAndroid* GetInstance();
41 static bool RegisterGcmPlatformImplAndroid(JNIEnv* env);
42
43 private:
44 friend struct DefaultSingletonTraits<GcmPlatformImplAndroid>;
45
46 GcmPlatformImplAndroid();
47 virtual ~GcmPlatformImplAndroid();
48
49 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
50 content::PushMessagingMessageFilter* observer_;
51 content::PushMessagingService::RegisterCallback register_cb_;
52
53 DISALLOW_COPY_AND_ASSIGN(GcmPlatformImplAndroid);
54 };
55
56 #endif // CHROME_BROWSER_ANDROID_GCM_ANDROID_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/gcm_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698