| 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_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> |
| 11 #include <string> |
| 10 | 12 |
| 11 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
| 13 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/notifications/notification.h" | 16 #include "chrome/browser/notifications/notification.h" |
| 15 #include "content/public/browser/platform_notification_service.h" | 17 #include "content/public/browser/platform_notification_service.h" |
| 16 #include "content/public/common/persistent_notification_status.h" | 18 #include "content/public/common/persistent_notification_status.h" |
| 17 | 19 |
| 18 class NotificationDelegate; | 20 class NotificationDelegate; |
| 19 class NotificationUIManager; | 21 class NotificationUIManager; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 base::Closure* cancel_callback) override; | 73 base::Closure* cancel_callback) override; |
| 72 void DisplayPersistentNotification( | 74 void DisplayPersistentNotification( |
| 73 content::BrowserContext* browser_context, | 75 content::BrowserContext* browser_context, |
| 74 int64_t persistent_notification_id, | 76 int64_t persistent_notification_id, |
| 75 const GURL& origin, | 77 const GURL& origin, |
| 76 const SkBitmap& icon, | 78 const SkBitmap& icon, |
| 77 const content::PlatformNotificationData& notification_data) override; | 79 const content::PlatformNotificationData& notification_data) override; |
| 78 void ClosePersistentNotification( | 80 void ClosePersistentNotification( |
| 79 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
| 80 int64_t persistent_notification_id) override; | 82 int64_t persistent_notification_id) override; |
| 83 bool GetDisplayedPersistentNotifications( |
| 84 content::BrowserContext* browser_context, |
| 85 std::set<std::string>* displayed_notifications) override; |
| 81 | 86 |
| 82 private: | 87 private: |
| 83 friend struct DefaultSingletonTraits<PlatformNotificationServiceImpl>; | 88 friend struct DefaultSingletonTraits<PlatformNotificationServiceImpl>; |
| 84 friend class PlatformNotificationServiceBrowserTest; | 89 friend class PlatformNotificationServiceBrowserTest; |
| 85 friend class PlatformNotificationServiceTest; | 90 friend class PlatformNotificationServiceTest; |
| 86 friend class PushMessagingBrowserTest; | 91 friend class PushMessagingBrowserTest; |
| 87 FRIEND_TEST_ALL_PREFIXES( | 92 FRIEND_TEST_ALL_PREFIXES( |
| 88 PlatformNotificationServiceTest, DisplayNameForOrigin); | 93 PlatformNotificationServiceTest, DisplayNameForOrigin); |
| 89 FRIEND_TEST_ALL_PREFIXES(PlatformNotificationServiceTest, | 94 FRIEND_TEST_ALL_PREFIXES(PlatformNotificationServiceTest, |
| 90 TestWebOriginDisplayName); | 95 TestWebOriginDisplayName); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 NotificationUIManager* notification_ui_manager_for_tests_; | 128 NotificationUIManager* notification_ui_manager_for_tests_; |
| 124 | 129 |
| 125 // Mapping between a persistent notification id and the id of the associated | 130 // Mapping between a persistent notification id and the id of the associated |
| 126 // message_center::Notification object. Must only be used on the UI thread. | 131 // message_center::Notification object. Must only be used on the UI thread. |
| 127 std::map<int64_t, std::string> persistent_notifications_; | 132 std::map<int64_t, std::string> persistent_notifications_; |
| 128 | 133 |
| 129 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); | 134 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
| 130 }; | 135 }; |
| 131 | 136 |
| 132 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 137 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
| OLD | NEW |