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> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "chrome/browser/notifications/notification_common.h" |
16 #include "chrome/browser/notifications/notification_platform_bridge.h" | 17 #include "chrome/browser/notifications/notification_platform_bridge.h" |
17 | 18 |
18 namespace user_prefs { | 19 namespace user_prefs { |
19 class PrefRegistrySyncable; | 20 class PrefRegistrySyncable; |
20 } | 21 } |
21 | 22 |
22 // Implementation of the NotificationPlatformBridge for Android, which defers to | 23 // Implementation of the NotificationPlatformBridge for Android, which defers to |
23 // the Android framework for displaying notifications. | 24 // the Android framework for displaying notifications. |
24 // | 25 // |
25 // Prior to Android Marshmellow, Android did not have the ability to retrieve | 26 // Prior to Android Marshmellow, Android did not have the ability to retrieve |
(...skipping 27 matching lines...) Expand all Loading... |
53 JNIEnv* env, | 54 JNIEnv* env, |
54 const base::android::JavaParamRef<jobject>& java_object, | 55 const base::android::JavaParamRef<jobject>& java_object, |
55 jlong persistent_notification_id, | 56 jlong persistent_notification_id, |
56 const base::android::JavaParamRef<jstring>& java_origin, | 57 const base::android::JavaParamRef<jstring>& java_origin, |
57 const base::android::JavaParamRef<jstring>& java_profile_id, | 58 const base::android::JavaParamRef<jstring>& java_profile_id, |
58 jboolean incognito, | 59 jboolean incognito, |
59 const base::android::JavaParamRef<jstring>& java_tag, | 60 const base::android::JavaParamRef<jstring>& java_tag, |
60 jboolean by_user); | 61 jboolean by_user); |
61 | 62 |
62 // NotificationPlatformBridge implementation. | 63 // NotificationPlatformBridge implementation. |
63 void Display(const std::string& notification_id, | 64 void Display(NotificationCommon::Type notification_type, |
| 65 const std::string& notification_id, |
64 const std::string& profile_id, | 66 const std::string& profile_id, |
65 bool incognito, | 67 bool incognito, |
66 const Notification& notification) override; | 68 const Notification& notification) override; |
67 void Close(const std::string& profile_id, | 69 void Close(const std::string& profile_id, |
68 const std::string& notification_id) override; | 70 const std::string& notification_id) override; |
69 bool GetDisplayed(const std::string& profile_id, | 71 bool GetDisplayed(const std::string& profile_id, |
70 bool incognito, | 72 bool incognito, |
71 std::set<std::string>* notifications) const override; | 73 std::set<std::string>* notifications) const override; |
72 bool SupportsNotificationCenter() const override; | 74 bool SupportsNotificationCenter() const override; |
73 | 75 |
(...skipping 23 matching lines...) Expand all Loading... |
97 // notifications are created by the content/ layer. | 99 // notifications are created by the content/ layer. |
98 std::map<int64_t, RegeneratedNotificationInfo> | 100 std::map<int64_t, RegeneratedNotificationInfo> |
99 regenerated_notification_infos_; | 101 regenerated_notification_infos_; |
100 | 102 |
101 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 103 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
102 | 104 |
103 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); | 105 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); |
104 }; | 106 }; |
105 | 107 |
106 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ | 108 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
OLD | NEW |