| 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 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 virtual ~NotificationUIManager() {} | 23 virtual ~NotificationUIManager() {} |
| 24 | 24 |
| 25 // Creates an initialized UI manager. | 25 // Creates an initialized UI manager. |
| 26 static NotificationUIManager* Create(PrefService* local_state); | 26 static NotificationUIManager* Create(PrefService* local_state); |
| 27 | 27 |
| 28 // Adds a notification to be displayed. Virtual for unit test override. | 28 // Adds a notification to be displayed. Virtual for unit test override. |
| 29 virtual void Add(const Notification& notification, | 29 virtual void Add(const Notification& notification, |
| 30 Profile* profile) = 0; | 30 Profile* profile) = 0; |
| 31 | 31 |
| 32 // Returns true if any notifications match the supplied ID, either currently | 32 // Returns the pointer to a notification if it match the supplied ID, either |
| 33 // displayed or in the queue. | 33 // currently displayed or in the queue. |
| 34 virtual bool DoesIdExist(const std::string& notification_id) = 0; | 34 virtual const Notification* FindById( |
| 35 const std::string& notification_id) const = 0; |
| 35 | 36 |
| 36 // Removes any notifications matching the supplied ID, either currently | 37 // Removes any notifications matching the supplied ID, either currently |
| 37 // displayed or in the queue. Returns true if anything was removed. | 38 // displayed or in the queue. Returns true if anything was removed. |
| 38 virtual bool CancelById(const std::string& notification_id) = 0; | 39 virtual bool CancelById(const std::string& notification_id) = 0; |
| 39 | 40 |
| 40 // Adds the notification_id for each outstanding notification to the set | 41 // Adds the notification_id for each outstanding notification to the set |
| 41 // |notification_ids| (must not be NULL). | 42 // |notification_ids| (must not be NULL). |
| 42 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 43 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| 43 Profile* profile, | 44 Profile* profile, |
| 44 const GURL& source) = 0; | 45 const GURL& source) = 0; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 static bool DelegatesToMessageCenter(); | 63 static bool DelegatesToMessageCenter(); |
| 63 | 64 |
| 64 protected: | 65 protected: |
| 65 NotificationUIManager() {} | 66 NotificationUIManager() {} |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 69 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 72 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |