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

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

Issue 4635007: When an extension is uninstalled, close all desktop notifications from that e... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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) 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_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>
12 #include <string>
12 13
13 #include "base/callback.h" 14 #include "base/callback.h"
14 #include "base/scoped_ptr.h" 15 #include "base/scoped_ptr.h"
15 16
16 class Balloon; 17 class Balloon;
18 class GURL;
17 class Notification; 19 class Notification;
18 class Profile; 20 class Profile;
19 21
20 namespace gfx { 22 namespace gfx {
21 class Size; 23 class Size;
22 } // namespace gfx 24 } // namespace gfx
23 25
24 class BalloonCollection { 26 class BalloonCollection {
25 public: 27 public:
26 class BalloonSpaceChangeListener { 28 class BalloonSpaceChangeListener {
(...skipping 10 matching lines...) Expand all
37 BalloonCollection() 39 BalloonCollection()
38 : space_change_listener_(NULL) { 40 : space_change_listener_(NULL) {
39 } 41 }
40 42
41 virtual ~BalloonCollection() {} 43 virtual ~BalloonCollection() {}
42 44
43 // Adds a new balloon for the specified notification. 45 // Adds a new balloon for the specified notification.
44 virtual void Add(const Notification& notification, 46 virtual void Add(const Notification& notification,
45 Profile* profile) = 0; 47 Profile* profile) = 0;
46 48
47 // Removes a balloon from the collection if present. Returns 49 // Removes any balloons that have this notification id.
48 // true if anything was removed. 50 virtual bool RemoveById(const std::string& id) = 0;
49 virtual bool Remove(const Notification& notification) = 0; 51
52 // Removes any balloons that have this source origin.
53 virtual bool RemoveBySourceOrigin(const GURL& source_origin) = 0;
50 54
51 // Is there room to add another notification? 55 // Is there room to add another notification?
52 virtual bool HasSpace() const = 0; 56 virtual bool HasSpace() const = 0;
53 57
54 // Request the resizing of a balloon. 58 // Request the resizing of a balloon.
55 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) = 0; 59 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) = 0;
56 60
57 // Update for new screen dimensions. 61 // Update for new screen dimensions.
58 virtual void DisplayChanged() = 0; 62 virtual void DisplayChanged() = 0;
59 63
(...skipping 18 matching lines...) Expand all
78 protected: 82 protected:
79 // Non-owned pointer to an object listening for space changes. 83 // Non-owned pointer to an object listening for space changes.
80 BalloonSpaceChangeListener* space_change_listener_; 84 BalloonSpaceChangeListener* space_change_listener_;
81 85
82 // For use only with testing. This callback is invoked when a balloon 86 // For use only with testing. This callback is invoked when a balloon
83 // is added or removed from the collection. 87 // is added or removed from the collection.
84 scoped_ptr<Callback0::Type> on_collection_changed_callback_; 88 scoped_ptr<Callback0::Type> on_collection_changed_callback_;
85 }; 89 };
86 90
87 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_ 91 #endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698