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/displayed_notifications_dispatch_callback
.h" |
16 #include "chrome/browser/notifications/notification_common.h" | 17 #include "chrome/browser/notifications/notification_common.h" |
17 #include "chrome/browser/notifications/notification_platform_bridge.h" | 18 #include "chrome/browser/notifications/notification_platform_bridge.h" |
18 | 19 |
19 namespace user_prefs { | 20 namespace user_prefs { |
20 class PrefRegistrySyncable; | 21 class PrefRegistrySyncable; |
21 } | 22 } |
22 | 23 |
23 // Implementation of the NotificationPlatformBridge for Android, which defers to | 24 // Implementation of the NotificationPlatformBridge for Android, which defers to |
24 // the Android framework for displaying notifications. | 25 // the Android framework for displaying notifications. |
25 // | 26 // |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void Display(NotificationCommon::Type notification_type, | 66 void Display(NotificationCommon::Type notification_type, |
66 const std::string& notification_id, | 67 const std::string& notification_id, |
67 const std::string& profile_id, | 68 const std::string& profile_id, |
68 bool incognito, | 69 bool incognito, |
69 const Notification& notification) override; | 70 const Notification& notification) override; |
70 void Close(const std::string& profile_id, | 71 void Close(const std::string& profile_id, |
71 const std::string& notification_id) override; | 72 const std::string& notification_id) override; |
72 void GetDisplayed( | 73 void GetDisplayed( |
73 const std::string& profile_id, | 74 const std::string& profile_id, |
74 bool incognito, | 75 bool incognito, |
75 const DisplayedNotificationsCallback& callback) const override; | 76 const GetDisplayedNotificationsCallback& callback) const override; |
76 | 77 |
77 static bool RegisterNotificationPlatformBridge(JNIEnv* env); | 78 static bool RegisterNotificationPlatformBridge(JNIEnv* env); |
78 | 79 |
79 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 80 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
80 | 81 |
81 private: | 82 private: |
82 // Contains information necessary in order to enable closing notifications | 83 // Contains information necessary in order to enable closing notifications |
83 // that were not created by this instance of the manager. This list may not | 84 // that were not created by this instance of the manager. This list may not |
84 // contain the notifications that have not been interacted with since the last | 85 // contain the notifications that have not been interacted with since the last |
85 // restart of Chrome. | 86 // restart of Chrome. |
(...skipping 14 matching lines...) Expand all Loading... |
100 // notifications are created by the content/ layer. | 101 // notifications are created by the content/ layer. |
101 std::map<std::string, RegeneratedNotificationInfo> | 102 std::map<std::string, RegeneratedNotificationInfo> |
102 regenerated_notification_infos_; | 103 regenerated_notification_infos_; |
103 | 104 |
104 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 105 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); | 107 DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid); |
107 }; | 108 }; |
108 | 109 |
109 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ | 110 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PLATFORM_BRIDGE_ANDROID_H_ |
OLD | NEW |