Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 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 true if any notifications match the supplied ID, either currently |
| 33 // displayed or in the queue. | 33 // displayed or in the queue. If |matched_notification| is not NULL, it |
| 34 virtual bool DoesIdExist(const std::string& notification_id) = 0; | 34 // will contain the matched notification upon return. |
| 35 virtual bool DoesIdExist(const std::string& notification_id, | |
| 36 Notification* matched_notification) = 0; | |
|
dewittj
2013/07/24 23:09:53
Should we just return Notification* instead of boo
jianli
2013/07/25 01:02:41
Changed to return Notification pointer and renamed
| |
| 35 | 37 |
| 36 // Removes any notifications matching the supplied ID, either currently | 38 // Removes any notifications matching the supplied ID, either currently |
| 37 // displayed or in the queue. Returns true if anything was removed. | 39 // displayed or in the queue. Returns true if anything was removed. |
| 38 virtual bool CancelById(const std::string& notification_id) = 0; | 40 virtual bool CancelById(const std::string& notification_id) = 0; |
| 39 | 41 |
| 40 // Adds the notification_id for each outstanding notification to the set | 42 // Adds the notification_id for each outstanding notification to the set |
| 41 // |notification_ids| (must not be NULL). | 43 // |notification_ids| (must not be NULL). |
| 42 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 44 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| 43 Profile* profile, | 45 Profile* profile, |
| 44 const GURL& source) = 0; | 46 const GURL& source) = 0; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 62 static bool DelegatesToMessageCenter(); | 64 static bool DelegatesToMessageCenter(); |
| 63 | 65 |
| 64 protected: | 66 protected: |
| 65 NotificationUIManager() {} | 67 NotificationUIManager() {} |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 70 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 73 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |