| 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 23 matching lines...) Expand all Loading... |
| 34 // Convert a profile pointer into an opaque profile id, which can be safely | 34 // Convert a profile pointer into an opaque profile id, which can be safely |
| 35 // used by FindById() and CancelById() even after a profile may have been | 35 // used by FindById() and CancelById() even after a profile may have been |
| 36 // destroyed. | 36 // destroyed. |
| 37 static ProfileID GetProfileID(Profile* profile) { | 37 static ProfileID GetProfileID(Profile* profile) { |
| 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 |
| 45 // crbug.com/530376 |
| 44 static NotificationUIManager* Create(PrefService* local_state); | 46 static NotificationUIManager* Create(PrefService* local_state); |
| 45 | 47 |
| 46 // Adds a notification to be displayed. Virtual for unit test override. | 48 // Adds a notification to be displayed. Virtual for unit test override. |
| 47 virtual void Add(const Notification& notification, Profile* profile) = 0; | 49 virtual void Add(const Notification& notification, Profile* profile) = 0; |
| 48 | 50 |
| 49 // Updates an existing notification. If |update_progress_only|, assume | 51 // Updates an existing notification. If |update_progress_only|, assume |
| 50 // only message and progress properties are updated. | 52 // only message and progress properties are updated. |
| 51 virtual bool Update(const Notification& notification, Profile* profile) = 0; | 53 virtual bool Update(const Notification& notification, Profile* profile) = 0; |
| 52 | 54 |
| 53 // 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual void CancelAll() = 0; | 90 virtual void CancelAll() = 0; |
| 89 | 91 |
| 90 protected: | 92 protected: |
| 91 NotificationUIManager() {} | 93 NotificationUIManager() {} |
| 92 | 94 |
| 93 private: | 95 private: |
| 94 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 96 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 99 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |