| 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> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 15 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 16 #include "chrome/browser/notifications/notification.h" | 17 #include "chrome/browser/notifications/notification.h" |
| 17 #include "content/public/browser/platform_notification_service.h" | 18 #include "content/public/browser/platform_notification_service.h" |
| 18 #include "content/public/common/persistent_notification_status.h" | 19 #include "content/public/common/persistent_notification_status.h" |
| 19 | 20 |
| 20 class NotificationDelegate; | 21 class NotificationDelegate; |
| 21 class NotificationUIManager; | 22 class NotificationUIManager; |
| 22 class Profile; | 23 class Profile; |
| 23 | 24 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 NotificationDelegate* delegate) const; | 118 NotificationDelegate* delegate) const; |
| 118 | 119 |
| 119 // Overrides the Notification UI Manager to use to |manager|. Only to be | 120 // Overrides the Notification UI Manager to use to |manager|. Only to be |
| 120 // used by tests. Tests are responsible for cleaning up after themselves. | 121 // used by tests. Tests are responsible for cleaning up after themselves. |
| 121 void SetNotificationUIManagerForTesting(NotificationUIManager* manager); | 122 void SetNotificationUIManagerForTesting(NotificationUIManager* manager); |
| 122 | 123 |
| 123 // Returns a display name for an origin, to be used in the context message | 124 // Returns a display name for an origin, to be used in the context message |
| 124 base::string16 DisplayNameForContextMessage(Profile* profile, | 125 base::string16 DisplayNameForContextMessage(Profile* profile, |
| 125 const GURL& origin) const; | 126 const GURL& origin) const; |
| 126 | 127 |
| 128 scoped_ptr<NotificationUIManager> native_notification_ui_manager_; |
| 129 |
| 127 // Weak reference. Ownership maintains with the test. | 130 // Weak reference. Ownership maintains with the test. |
| 128 NotificationUIManager* notification_ui_manager_for_tests_; | 131 NotificationUIManager* notification_ui_manager_for_tests_; |
| 129 | 132 |
| 130 // Mapping between a persistent notification id and the id of the associated | 133 // Mapping between a persistent notification id and the id of the associated |
| 131 // message_center::Notification object. Must only be used on the UI thread. | 134 // message_center::Notification object. Must only be used on the UI thread. |
| 132 std::map<int64_t, std::string> persistent_notifications_; | 135 std::map<int64_t, std::string> persistent_notifications_; |
| 133 | 136 |
| 134 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); | 137 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
| 135 }; | 138 }; |
| 136 | 139 |
| 137 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 140 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
| OLD | NEW |