| OLD | NEW |
| 1 // Copyright (c) 2010 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <deque> | 11 #include <deque> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 41 LOWER_RIGHT = 1, | 41 LOWER_RIGHT = 1, |
| 42 UPPER_LEFT = 2, | 42 UPPER_LEFT = 2, |
| 43 LOWER_LEFT = 3, | 43 LOWER_LEFT = 3, |
| 44 | 44 |
| 45 // The default position is different on different platforms. | 45 // The default position is different on different platforms. |
| 46 DEFAULT_POSITION = -1 | 46 DEFAULT_POSITION = -1 |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 static BalloonCollection* Create(); | 49 static BalloonCollection* Create(); |
| 50 | 50 |
| 51 BalloonCollection() | 51 BalloonCollection(); |
| 52 : space_change_listener_(NULL) { | |
| 53 } | |
| 54 | 52 |
| 55 virtual ~BalloonCollection() {} | 53 virtual ~BalloonCollection(); |
| 56 | 54 |
| 57 // Adds a new balloon for the specified notification. | 55 // Adds a new balloon for the specified notification. |
| 58 virtual void Add(const Notification& notification, | 56 virtual void Add(const Notification& notification, |
| 59 Profile* profile) = 0; | 57 Profile* profile) = 0; |
| 60 | 58 |
| 61 // Removes any balloons that have this notification id. Returns | 59 // Removes any balloons that have this notification id. Returns |
| 62 // true if anything was removed. | 60 // true if anything was removed. |
| 63 virtual bool RemoveById(const std::string& id) = 0; | 61 virtual bool RemoveById(const std::string& id) = 0; |
| 64 | 62 |
| 65 // Removes any balloons that have this source origin. Returns | 63 // Removes any balloons that have this source origin. Returns |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 protected: | 100 protected: |
| 103 // Non-owned pointer to an object listening for space changes. | 101 // Non-owned pointer to an object listening for space changes. |
| 104 BalloonSpaceChangeListener* space_change_listener_; | 102 BalloonSpaceChangeListener* space_change_listener_; |
| 105 | 103 |
| 106 // For use only with testing. This callback is invoked when a balloon | 104 // For use only with testing. This callback is invoked when a balloon |
| 107 // is added or removed from the collection. | 105 // is added or removed from the collection. |
| 108 scoped_ptr<Callback0::Type> on_collection_changed_callback_; | 106 scoped_ptr<Callback0::Type> on_collection_changed_callback_; |
| 109 }; | 107 }; |
| 110 | 108 |
| 111 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ | 109 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ |
| OLD | NEW |