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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
14 #include "chrome/browser/notifications/notification_ui_manager.h" | 14 #include "chrome/browser/notifications/notification_ui_manager.h" |
15 | 15 |
16 class ProfileNotification; | 16 class ProfileNotification; |
17 | 17 |
18 // Implementation of the Notification UI Manager for Android, which defers to | 18 // Implementation of the Notification UI Manager for Android, which defers to |
19 // the Android framework for displaying notifications. | 19 // the Android framework for displaying notifications. |
20 class NotificationUIManagerAndroid : public NotificationUIManager { | 20 class NotificationUIManagerAndroid : public NotificationUIManager { |
21 public: | 21 public: |
22 NotificationUIManagerAndroid(); | 22 NotificationUIManagerAndroid(); |
23 ~NotificationUIManagerAndroid() override; | 23 ~NotificationUIManagerAndroid() override; |
24 | 24 |
25 // Called by the Java implementation when a notification has been clicked on. | 25 // Called by the Java implementation when a notification has been clicked on. |
26 bool OnNotificationClicked(JNIEnv* env, | 26 bool OnNotificationClicked(JNIEnv* env, |
27 jobject java_object, | 27 jobject java_object, |
28 jstring notification_id); | 28 jstring notification_id, |
| 29 jbyteArray serialized_notification_data); |
29 | 30 |
30 // Called by the Java implementation when a notification has been closed. | 31 // Called by the Java implementation when a notification has been closed. |
31 bool OnNotificationClosed(JNIEnv* env, | 32 bool OnNotificationClosed(JNIEnv* env, |
32 jobject java_object, | 33 jobject java_object, |
33 jstring notification_id); | 34 jstring notification_id); |
34 | 35 |
35 // NotificationUIManager implementation; | 36 // NotificationUIManager implementation; |
36 void Add(const Notification& notification, Profile* profile) override; | 37 void Add(const Notification& notification, Profile* profile) override; |
37 bool Update(const Notification& notification, | 38 bool Update(const Notification& notification, |
38 Profile* profile) override; | 39 Profile* profile) override; |
(...skipping 28 matching lines...) Expand all Loading... |
67 | 68 |
68 // Map from notification id to the associated platform Id. | 69 // Map from notification id to the associated platform Id. |
69 std::map<std::string, int> platform_notifications_; | 70 std::map<std::string, int> platform_notifications_; |
70 | 71 |
71 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 72 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); | 74 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); |
74 }; | 75 }; |
75 | 76 |
76 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 77 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
OLD | NEW |