| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Handles the visible notification (or balloons). | 5 // Handles the visible notification (or balloons). |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ | 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ |
| 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ | 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 BalloonCollection(); | 49 BalloonCollection(); |
| 50 | 50 |
| 51 virtual ~BalloonCollection(); | 51 virtual ~BalloonCollection(); |
| 52 | 52 |
| 53 // Adds a new balloon for the specified notification. | 53 // Adds a new balloon for the specified notification. |
| 54 virtual void Add(const Notification& notification, | 54 virtual void Add(const Notification& notification, |
| 55 Profile* profile) = 0; | 55 Profile* profile) = 0; |
| 56 | 56 |
| 57 // Returns true if any balloon has this notification id. | 57 // Returns true if any balloon has this notification id. |
| 58 virtual bool DoesIdExist(const std::string& id) = 0; | 58 virtual const Notification* FindById(const std::string& id) const = 0; |
| 59 | 59 |
| 60 // Removes any balloons that have this notification id. Returns | 60 // Removes any balloons that have this notification id. Returns |
| 61 // true if anything was removed. | 61 // true if anything was removed. |
| 62 virtual bool RemoveById(const std::string& id) = 0; | 62 virtual bool RemoveById(const std::string& id) = 0; |
| 63 | 63 |
| 64 // Removes any balloons that have this source origin. Returns | 64 // Removes any balloons that have this source origin. Returns |
| 65 // true if anything was removed. | 65 // true if anything was removed. |
| 66 virtual bool RemoveBySourceOrigin(const GURL& source_origin) = 0; | 66 virtual bool RemoveBySourceOrigin(const GURL& source_origin) = 0; |
| 67 | 67 |
| 68 // Removes any balloons matching |profile. Returns true if any were removed. | 68 // Removes any balloons matching |profile. Returns true if any were removed. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 protected: | 104 protected: |
| 105 // Non-owned pointer to an object listening for space changes. | 105 // Non-owned pointer to an object listening for space changes. |
| 106 BalloonSpaceChangeListener* space_change_listener_; | 106 BalloonSpaceChangeListener* space_change_listener_; |
| 107 | 107 |
| 108 // For use only with testing. This callback is invoked when a balloon | 108 // For use only with testing. This callback is invoked when a balloon |
| 109 // is added or removed from the collection. | 109 // is added or removed from the collection. |
| 110 base::Closure on_collection_changed_callback_; | 110 base::Closure on_collection_changed_callback_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ | 113 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ |
| OLD | NEW |