| 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 22 matching lines...) Expand all Loading... |
| 33 ~NotificationPlatformBridgeAndroid() override; | 33 ~NotificationPlatformBridgeAndroid() override; |
| 34 | 34 |
| 35 // Called by the Java implementation when the notification has been clicked. | 35 // Called by the Java implementation when the notification has been clicked. |
| 36 void OnNotificationClicked( | 36 void OnNotificationClicked( |
| 37 JNIEnv* env, | 37 JNIEnv* env, |
| 38 const base::android::JavaParamRef<jobject>& java_object, | 38 const base::android::JavaParamRef<jobject>& java_object, |
| 39 jlong persistent_notification_id, | 39 jlong persistent_notification_id, |
| 40 const base::android::JavaParamRef<jstring>& java_origin, | 40 const base::android::JavaParamRef<jstring>& java_origin, |
| 41 const base::android::JavaParamRef<jstring>& java_profile_id, | 41 const base::android::JavaParamRef<jstring>& java_profile_id, |
| 42 jboolean incognito, | 42 jboolean incognito, |
| 43 const base::android::JavaParamRef<jstring>& java_web_apk_package, | 43 const base::android::JavaParamRef<jstring>& java_webapk_package, |
| 44 const base::android::JavaParamRef<jstring>& java_tag, | 44 const base::android::JavaParamRef<jstring>& java_tag, |
| 45 jint action_index); | 45 jint action_index); |
| 46 | 46 |
| 47 // Called by the Java implementation when the notification has been closed. | 47 // Called by the Java implementation when the notification has been closed. |
| 48 void OnNotificationClosed( | 48 void OnNotificationClosed( |
| 49 JNIEnv* env, | 49 JNIEnv* env, |
| 50 const base::android::JavaParamRef<jobject>& java_object, | 50 const base::android::JavaParamRef<jobject>& java_object, |
| 51 jlong persistent_notification_id, | 51 jlong persistent_notification_id, |
| 52 const base::android::JavaParamRef<jstring>& java_origin, | 52 const base::android::JavaParamRef<jstring>& java_origin, |
| 53 const base::android::JavaParamRef<jstring>& java_profile_id, | 53 const base::android::JavaParamRef<jstring>& java_profile_id, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 // Contains information necessary in order to enable closing notifications | 73 // Contains information necessary in order to enable closing notifications |
| 74 // that were not created by this instance of the manager. This list may not | 74 // that were not created by this instance of the manager. This list may not |
| 75 // contain the notifications that have not been interacted with since the last | 75 // contain the notifications that have not been interacted with since the last |
| 76 // restart of Chrome. | 76 // restart of Chrome. |
| 77 struct RegeneratedNotificationInfo { | 77 struct RegeneratedNotificationInfo { |
| 78 RegeneratedNotificationInfo(); | 78 RegeneratedNotificationInfo(); |
| 79 RegeneratedNotificationInfo(const std::string& origin, | 79 RegeneratedNotificationInfo(const std::string& origin, |
| 80 const std::string& tag, | 80 const std::string& tag, |
| 81 const std::string& web_apk_package); | 81 const std::string& webapk_package); |
| 82 ~RegeneratedNotificationInfo(); | 82 ~RegeneratedNotificationInfo(); |
| 83 | 83 |
| 84 std::string origin; | 84 std::string origin; |
| 85 std::string tag; | 85 std::string tag; |
| 86 std::string web_apk_package; | 86 std::string webapk_package; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // Mapping of a persistent notification id to renegerated notification info. | 89 // Mapping of a persistent notification id to renegerated notification info. |
| 90 // TODO(peter): Remove this map once notification delegate ids for Web | 90 // TODO(peter): Remove this map once notification delegate ids for Web |
| 91 // notifications are created by the content/ layer. | 91 // notifications are created by the content/ layer. |
| 92 std::map<int64_t, RegeneratedNotificationInfo> | 92 std::map<int64_t, RegeneratedNotificationInfo> |
| 93 regenerated_notification_infos_; | 93 regenerated_notification_infos_; |
| 94 | 94 |
| 95 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 95 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); | 97 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ | 100 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
| OLD | NEW |