| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return static_cast<ProfileID>(profile); | 38 return static_cast<ProfileID>(profile); |
| 39 } | 39 } |
| 40 | 40 |
| 41 virtual ~NotificationUIManager() {} | 41 virtual ~NotificationUIManager() {} |
| 42 | 42 |
| 43 // Creates an initialized UI manager. | 43 // Creates an initialized UI manager. |
| 44 // TODO(dewittj): Remove the PrefService argument which is unused. See | 44 // TODO(dewittj): Remove the PrefService argument which is unused. See |
| 45 // crbug.com/530376 | 45 // crbug.com/530376 |
| 46 static NotificationUIManager* Create(PrefService* local_state); | 46 static NotificationUIManager* Create(PrefService* local_state); |
| 47 | 47 |
| 48 // Some platforms can integrate notifications with their own | |
| 49 // notification center. In those cases it will return a pointer | |
| 50 // to the object dealing with OS specific notifications which will | |
| 51 // be owned by the caller. | |
| 52 // Otherwise it will return null and chrome notifications will be | |
| 53 // used instead. | |
| 54 static NotificationUIManager* CreateNativeNotificationManager(); | |
| 55 | |
| 56 // Adds a notification to be displayed. Virtual for unit test override. | 48 // Adds a notification to be displayed. Virtual for unit test override. |
| 57 virtual void Add(const Notification& notification, Profile* profile) = 0; | 49 virtual void Add(const Notification& notification, Profile* profile) = 0; |
| 58 | 50 |
| 59 // Updates an existing notification. If |update_progress_only|, assume | 51 // Updates an existing notification. If |update_progress_only|, assume |
| 60 // only message and progress properties are updated. | 52 // only message and progress properties are updated. |
| 61 virtual bool Update(const Notification& notification, Profile* profile) = 0; | 53 virtual bool Update(const Notification& notification, Profile* profile) = 0; |
| 62 | 54 |
| 63 // Returns the pointer to a notification if it match the supplied ID, either | 55 // Returns the pointer to a notification if it match the supplied ID, either |
| 64 // currently displayed or in the queue. | 56 // currently displayed or in the queue. |
| 65 // This function can be bound for delayed execution, where a profile pointer | 57 // This function can be bound for delayed execution, where a profile pointer |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 virtual void CancelAll() = 0; | 90 virtual void CancelAll() = 0; |
| 99 | 91 |
| 100 protected: | 92 protected: |
| 101 NotificationUIManager() {} | 93 NotificationUIManager() {} |
| 102 | 94 |
| 103 private: | 95 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 96 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 105 }; | 97 }; |
| 106 | 98 |
| 107 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 99 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |