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