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_PLATFORM_BRIDGE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <map> | 10 #include <map> |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Android. | 34 // Android. |
35 class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge { | 35 class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge { |
36 public: | 36 public: |
37 NotificationPlatformBridgeAndroid(); | 37 NotificationPlatformBridgeAndroid(); |
38 ~NotificationPlatformBridgeAndroid() override; | 38 ~NotificationPlatformBridgeAndroid() override; |
39 | 39 |
40 // Called by the Java implementation when the notification has been clicked. | 40 // Called by the Java implementation when the notification has been clicked. |
41 void OnNotificationClicked( | 41 void OnNotificationClicked( |
42 JNIEnv* env, | 42 JNIEnv* env, |
43 const base::android::JavaParamRef<jobject>& java_object, | 43 const base::android::JavaParamRef<jobject>& java_object, |
44 jlong persistent_notification_id, | 44 const base::android::JavaParamRef<jstring>& java_notification_id, |
45 const base::android::JavaParamRef<jstring>& java_origin, | 45 const base::android::JavaParamRef<jstring>& java_origin, |
46 const base::android::JavaParamRef<jstring>& java_profile_id, | 46 const base::android::JavaParamRef<jstring>& java_profile_id, |
47 jboolean incognito, | 47 jboolean incognito, |
48 const base::android::JavaParamRef<jstring>& java_tag, | 48 const base::android::JavaParamRef<jstring>& java_tag, |
49 const base::android::JavaParamRef<jstring>& java_webapk_package, | 49 const base::android::JavaParamRef<jstring>& java_webapk_package, |
50 jint action_index); | 50 jint action_index); |
51 | 51 |
52 // Called by the Java implementation when the notification has been closed. | 52 // Called by the Java implementation when the notification has been closed. |
53 void OnNotificationClosed( | 53 void OnNotificationClosed( |
54 JNIEnv* env, | 54 JNIEnv* env, |
55 const base::android::JavaParamRef<jobject>& java_object, | 55 const base::android::JavaParamRef<jobject>& java_object, |
56 jlong persistent_notification_id, | 56 const base::android::JavaParamRef<jstring>& java_notification_id, |
57 const base::android::JavaParamRef<jstring>& java_origin, | 57 const base::android::JavaParamRef<jstring>& java_origin, |
58 const base::android::JavaParamRef<jstring>& java_profile_id, | 58 const base::android::JavaParamRef<jstring>& java_profile_id, |
59 jboolean incognito, | 59 jboolean incognito, |
60 const base::android::JavaParamRef<jstring>& java_tag, | 60 const base::android::JavaParamRef<jstring>& java_tag, |
61 jboolean by_user); | 61 jboolean by_user); |
62 | 62 |
63 // NotificationPlatformBridge implementation. | 63 // NotificationPlatformBridge implementation. |
64 void Display(NotificationCommon::Type notification_type, | 64 void Display(NotificationCommon::Type notification_type, |
65 const std::string& notification_id, | 65 const std::string& notification_id, |
66 const std::string& profile_id, | 66 const std::string& profile_id, |
(...skipping 20 matching lines...) Expand all Loading... |
87 RegeneratedNotificationInfo(const std::string& origin, | 87 RegeneratedNotificationInfo(const std::string& origin, |
88 const std::string& tag, | 88 const std::string& tag, |
89 const std::string& webapk_package); | 89 const std::string& webapk_package); |
90 ~RegeneratedNotificationInfo(); | 90 ~RegeneratedNotificationInfo(); |
91 | 91 |
92 std::string origin; | 92 std::string origin; |
93 std::string tag; | 93 std::string tag; |
94 std::string webapk_package; | 94 std::string webapk_package; |
95 }; | 95 }; |
96 | 96 |
97 // Mapping of a persistent notification id to renegerated notification info. | 97 // Mapping of notification id to renegerated notification info. |
98 // TODO(peter): Remove this map once notification delegate ids for Web | 98 // TODO(peter): Remove this map once notification delegate ids for Web |
99 // notifications are created by the content/ layer. | 99 // notifications are created by the content/ layer. |
100 std::map<int64_t, RegeneratedNotificationInfo> | 100 std::map<std::string, RegeneratedNotificationInfo> |
101 regenerated_notification_infos_; | 101 regenerated_notification_infos_; |
102 | 102 |
103 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 103 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); | 105 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); |
106 }; | 106 }; |
107 | 107 |
108 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ | 108 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
OLD | NEW |