Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: chrome/browser/notifications/balloon_collection_base.h

Issue 10537158: Add support for Ash to Notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win/mac compile Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 30 matching lines...) Expand all
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. 46 // Calls CloseByScript on all balloons.
47 virtual void CloseAll(); 47 virtual void CloseAll();
48 48
49 const Balloons& balloons() const { return balloons_; } 49 const Balloons& balloons() const { return balloons_; }
50 50
51 // Returns the balloon matching the given notification id, or
52 // NULL if there is no matching balloon.
53 Balloon* FindBalloonById(const std::string& notification_id);
54
51 // Returns the balloon matching the given notification, or 55 // Returns the balloon matching the given notification, or
52 // NULL if there is no matching balloon. 56 // NULL if there is no matching balloon.
53 Balloon* FindBalloon(const Notification& notification); 57 Balloon* FindBalloon(const Notification& notification);
54 58
55 // The number of balloons being displayed. 59 // The number of balloons being displayed.
56 int count() const { return static_cast<int>(balloons_.size()); } 60 int count() const { return static_cast<int>(balloons_.size()); }
57 61
58 private: 62 private:
59 // Queue of active balloons. Pointers are owned by this class. 63 // Queue of active balloons. Pointers are owned by this class.
60 Balloons balloons_; 64 Balloons balloons_;
61 65
62 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase); 66 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase);
63 }; 67 };
64 68
65 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ 69 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698