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 <string> | 10 #include <string> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 jstring java_tag); | 44 jstring java_tag); |
45 | 45 |
46 // NotificationUIManager implementation. | 46 // NotificationUIManager implementation. |
47 void Add(const Notification& notification, Profile* profile) override; | 47 void Add(const Notification& notification, Profile* profile) override; |
48 bool Update(const Notification& notification, | 48 bool Update(const Notification& notification, |
49 Profile* profile) override; | 49 Profile* profile) override; |
50 const Notification* FindById(const std::string& delegate_id, | 50 const Notification* FindById(const std::string& delegate_id, |
51 ProfileID profile_id) const override; | 51 ProfileID profile_id) const override; |
52 bool CancelById(const std::string& delegate_id, | 52 bool CancelById(const std::string& delegate_id, |
53 ProfileID profile_id) override; | 53 ProfileID profile_id) override; |
54 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(Profile* profile, | 54 std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
55 const GURL& source) | 55 ProfileID profile_id, |
56 override; | 56 const GURL& source) override; |
57 std::set<std::string> GetAllIdsByProfile(Profile* profile) override; | 57 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; |
58 bool CancelAllBySourceOrigin(const GURL& source_origin) override; | 58 bool CancelAllBySourceOrigin(const GURL& source_origin) override; |
59 bool CancelAllByProfile(ProfileID profile_id) override; | 59 bool CancelAllByProfile(ProfileID profile_id) override; |
60 void CancelAll() override; | 60 void CancelAll() override; |
61 | 61 |
62 static bool RegisterNotificationUIManager(JNIEnv* env); | 62 static bool RegisterNotificationUIManager(JNIEnv* env); |
63 | 63 |
64 private: | 64 private: |
65 // Pair containing the information necessary in order to enable closing | 65 // Pair containing the information necessary in order to enable closing |
66 // notifications that were not created by this instance of the manager: the | 66 // notifications that were not created by this instance of the manager: the |
67 // notification's origin and tag. This list may not contain the notifications | 67 // notification's origin and tag. This list may not contain the notifications |
68 // that have not been interacted with since the last restart of Chrome. | 68 // that have not been interacted with since the last restart of Chrome. |
69 using RegeneratedNotificationInfo = std::pair<std::string, std::string>; | 69 using RegeneratedNotificationInfo = std::pair<std::string, std::string>; |
70 | 70 |
71 // Mapping of a persistent notification id to renegerated notification info. | 71 // Mapping of a persistent notification id to renegerated notification info. |
72 // TODO(peter): Remove this map once notification delegate ids for Web | 72 // TODO(peter): Remove this map once notification delegate ids for Web |
73 // notifications are created by the content/ layer. | 73 // notifications are created by the content/ layer. |
74 std::map<int64_t, RegeneratedNotificationInfo> | 74 std::map<int64_t, RegeneratedNotificationInfo> |
75 regenerated_notification_infos_; | 75 regenerated_notification_infos_; |
76 | 76 |
77 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 77 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); | 79 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); |
80 }; | 80 }; |
81 | 81 |
82 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 82 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
OLD | NEW |