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 // Handles the visible notification (or balloons). | 5 // Handles the visible notification (or balloons). |
6 | 6 |
7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 7 #ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 8 #define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #define USE_OFFSETS 1 | 29 #define USE_OFFSETS 1 |
30 #endif | 30 #endif |
31 | 31 |
32 // A balloon collection represents a set of notification balloons being | 32 // A balloon collection represents a set of notification balloons being |
33 // shown on the screen. It positions new notifications according to | 33 // shown on the screen. It positions new notifications according to |
34 // a layout, and monitors for balloons being closed, which it reports | 34 // a layout, and monitors for balloons being closed, which it reports |
35 // up to its parent, the notification UI manager. | 35 // up to its parent, the notification UI manager. |
36 class BalloonCollectionImpl : public BalloonCollection, | 36 class BalloonCollectionImpl : public BalloonCollection, |
37 public content::NotificationObserver | 37 public content::NotificationObserver |
38 #if USE_OFFSETS | 38 #if USE_OFFSETS |
39 , public MessageLoopForUI::Observer | 39 , |
| 40 public base::MessageLoopForUI::Observer |
40 #endif | 41 #endif |
41 { | 42 { |
42 public: | 43 public: |
43 BalloonCollectionImpl(); | 44 BalloonCollectionImpl(); |
44 virtual ~BalloonCollectionImpl(); | 45 virtual ~BalloonCollectionImpl(); |
45 | 46 |
46 // BalloonCollection interface. | 47 // BalloonCollection interface. |
47 virtual void Add(const Notification& notification, | 48 virtual void Add(const Notification& notification, |
48 Profile* profile) OVERRIDE; | 49 Profile* profile) OVERRIDE; |
49 virtual bool DoesIdExist(const std::string& id) OVERRIDE; | 50 virtual bool DoesIdExist(const std::string& id) OVERRIDE; |
50 virtual bool RemoveById(const std::string& id) OVERRIDE; | 51 virtual bool RemoveById(const std::string& id) OVERRIDE; |
51 virtual bool RemoveBySourceOrigin(const GURL& source_origin) OVERRIDE; | 52 virtual bool RemoveBySourceOrigin(const GURL& source_origin) OVERRIDE; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 base::WeakPtrFactory<BalloonCollectionImpl> reposition_factory_; | 240 base::WeakPtrFactory<BalloonCollectionImpl> reposition_factory_; |
240 | 241 |
241 // Is the balloon collection currently listening for UI events? | 242 // Is the balloon collection currently listening for UI events? |
242 bool added_as_message_loop_observer_; | 243 bool added_as_message_loop_observer_; |
243 #endif | 244 #endif |
244 | 245 |
245 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImpl); | 246 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImpl); |
246 }; | 247 }; |
247 | 248 |
248 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ | 249 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_IMPL_H_ |
OLD | NEW |