| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 BalloonCollection* balloons); | 35 BalloonCollection* balloons); |
| 36 | 36 |
| 37 // Adds a notification to be displayed. Virtual for unit test override. | 37 // Adds a notification to be displayed. Virtual for unit test override. |
| 38 virtual void Add(const Notification& notification, | 38 virtual void Add(const Notification& notification, |
| 39 Profile* profile) = 0; | 39 Profile* profile) = 0; |
| 40 | 40 |
| 41 // Removes any notifications matching the supplied ID, either currently | 41 // Removes any notifications matching the supplied ID, either currently |
| 42 // displayed or in the queue. Returns true if anything was removed. | 42 // displayed or in the queue. Returns true if anything was removed. |
| 43 virtual bool CancelById(const std::string& notification_id) = 0; | 43 virtual bool CancelById(const std::string& notification_id) = 0; |
| 44 | 44 |
| 45 // Removes any notifications matching the supplied source origin | 45 // Removes notifications matching the |source_origin| (which could be an |
| 46 // (which could be an extension ID), either currently displayed or in the | 46 // extension ID). Returns true if anything was removed. |
| 47 // queue. Returns true if anything was removed. | |
| 48 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0; | 47 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0; |
| 49 | 48 |
| 49 // Removes notifications matching |profile|. Returns true if any were removed. |
| 50 virtual bool CancelAllByProfile(Profile* profile) = 0; |
| 51 |
| 50 // Cancels all pending notifications and closes anything currently showing. | 52 // Cancels all pending notifications and closes anything currently showing. |
| 51 // Used when the app is terminating. | 53 // Used when the app is terminating. |
| 52 virtual void CancelAll() = 0; | 54 virtual void CancelAll() = 0; |
| 53 | 55 |
| 54 // Returns balloon collection. | 56 // Returns balloon collection. |
| 55 virtual BalloonCollection* balloon_collection() = 0; | 57 virtual BalloonCollection* balloon_collection() = 0; |
| 56 | 58 |
| 57 // Returns the impl, for use primarily by testing. | 59 // Returns the impl, for use primarily by testing. |
| 58 virtual NotificationPrefsManager* prefs_manager() = 0; | 60 virtual NotificationPrefsManager* prefs_manager() = 0; |
| 59 | 61 |
| 60 // Retrieves an ordered list of all queued notifications. | 62 // Retrieves an ordered list of all queued notifications. |
| 61 // Used only for automation/testing. | 63 // Used only for automation/testing. |
| 62 virtual void GetQueuedNotificationsForTesting( | 64 virtual void GetQueuedNotificationsForTesting( |
| 63 std::vector<const Notification*>* notifications) {} | 65 std::vector<const Notification*>* notifications) {} |
| 64 | 66 |
| 65 protected: | 67 protected: |
| 66 NotificationUIManager() {} | 68 NotificationUIManager() {} |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 71 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 74 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |