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

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

Issue 20136004: Allow partial update for notification update API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 7 years, 5 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 9
10 #include <deque> 10 #include <deque>
(...skipping 16 matching lines...) Expand all
27 typedef std::deque<Balloon*> Balloons; 27 typedef std::deque<Balloon*> Balloons;
28 28
29 // Adds a balloon to the collection. Takes ownership of pointer. 29 // Adds a balloon to the collection. Takes ownership of pointer.
30 virtual void Add(Balloon* balloon, bool add_to_front); 30 virtual void Add(Balloon* balloon, bool add_to_front);
31 31
32 // Removes a balloon from the collection (if present). Frees 32 // Removes a balloon from the collection (if present). Frees
33 // the pointer after removal. 33 // the pointer after removal.
34 virtual void Remove(Balloon* balloon); 34 virtual void Remove(Balloon* balloon);
35 35
36 // Returns true if any balloon matches the given notification id. 36 // Returns true if any balloon matches the given notification id.
37 virtual bool DoesIdExist(const std::string& id); 37 virtual bool DoesIdExist(const std::string& id,
38 Notification* matched_notification);
38 39
39 // Finds any balloon matching the given notification id, and 40 // Finds any balloon matching the given notification id, and
40 // calls CloseByScript on it. Returns true if anything was 41 // calls CloseByScript on it. Returns true if anything was
41 // found. 42 // found.
42 virtual bool CloseById(const std::string& id); 43 virtual bool CloseById(const std::string& id);
43 44
44 // Finds all balloons matching the given notification source, 45 // Finds all balloons matching the given notification source,
45 // and calls CloseByScript on them. Returns true if anything 46 // and calls CloseByScript on them. Returns true if anything
46 // was found. 47 // was found.
47 virtual bool CloseAllBySourceOrigin(const GURL& source_origin); 48 virtual bool CloseAllBySourceOrigin(const GURL& source_origin);
(...skipping 19 matching lines...) Expand all
67 int count() const { return static_cast<int>(balloons_.size()); } 68 int count() const { return static_cast<int>(balloons_.size()); }
68 69
69 private: 70 private:
70 // Queue of active balloons. Pointers are owned by this class. 71 // Queue of active balloons. Pointers are owned by this class.
71 Balloons balloons_; 72 Balloons balloons_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase); 74 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase);
74 }; 75 };
75 76
76 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ 77 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698