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