| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_H_ | 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ |
| 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ | 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Finds any balloon matching the given notification id, and | 36 // Finds any balloon matching the given notification id, and |
| 37 // calls CloseByScript on it. Returns true if anything was | 37 // calls CloseByScript on it. Returns true if anything was |
| 38 // found. | 38 // found. |
| 39 virtual bool CloseById(const std::string& id); | 39 virtual bool CloseById(const std::string& id); |
| 40 | 40 |
| 41 // Finds all balloons matching the given notification source, | 41 // Finds all balloons matching the given notification source, |
| 42 // and calls CloseByScript on them. Returns true if anything | 42 // and calls CloseByScript on them. Returns true if anything |
| 43 // was found. | 43 // was found. |
| 44 virtual bool CloseAllBySourceOrigin(const GURL& source_origin); | 44 virtual bool CloseAllBySourceOrigin(const GURL& source_origin); |
| 45 | 45 |
| 46 // Calls CloseByScript on all balloons. |
| 47 virtual void CloseAll(); |
| 48 |
| 46 const Balloons& balloons() const { return balloons_; } | 49 const Balloons& balloons() const { return balloons_; } |
| 47 | 50 |
| 48 // Returns the balloon matching the given notification, or | 51 // Returns the balloon matching the given notification, or |
| 49 // NULL if there is no matching balloon. | 52 // NULL if there is no matching balloon. |
| 50 Balloon* FindBalloon(const Notification& notification); | 53 Balloon* FindBalloon(const Notification& notification); |
| 51 | 54 |
| 52 // The number of balloons being displayed. | 55 // The number of balloons being displayed. |
| 53 int count() const { return static_cast<int>(balloons_.size()); } | 56 int count() const { return static_cast<int>(balloons_.size()); } |
| 54 | 57 |
| 55 private: | 58 private: |
| 56 // Queue of active balloons. Pointers are owned by this class. | 59 // Queue of active balloons. Pointers are owned by this class. |
| 57 Balloons balloons_; | 60 Balloons balloons_; |
| 58 | 61 |
| 59 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase); | 62 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase); |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ | 65 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ |
| OLD | NEW |