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

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

Issue 14767029: Add API function chrome.notifications.getAll (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address dimich comments #2. Created 7 years, 7 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
7 7
8 #include <set>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
12 13
13 class GURL; 14 class GURL;
14 class Notification; 15 class Notification;
15 class PrefService; 16 class PrefService;
16 class Profile; 17 class Profile;
17 18
(...skipping 11 matching lines...) Expand all
29 Profile* profile) = 0; 30 Profile* profile) = 0;
30 31
31 // Returns true if any notifications match the supplied ID, either currently 32 // Returns true if any notifications match the supplied ID, either currently
32 // displayed or in the queue. 33 // displayed or in the queue.
33 virtual bool DoesIdExist(const std::string& notification_id) = 0; 34 virtual bool DoesIdExist(const std::string& notification_id) = 0;
34 35
35 // Removes any notifications matching the supplied ID, either currently 36 // Removes any notifications matching the supplied ID, either currently
36 // displayed or in the queue. Returns true if anything was removed. 37 // displayed or in the queue. Returns true if anything was removed.
37 virtual bool CancelById(const std::string& notification_id) = 0; 38 virtual bool CancelById(const std::string& notification_id) = 0;
38 39
40 // Adds the notification_id for each outstanding notification to the set
41 // |notification_ids| (must not be NULL).
42 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
43 Profile* profile,
44 const GURL& source) = 0;
45
39 // Removes notifications matching the |source_origin| (which could be an 46 // Removes notifications matching the |source_origin| (which could be an
40 // extension ID). Returns true if anything was removed. 47 // extension ID). Returns true if anything was removed.
41 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0; 48 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0;
42 49
43 // Removes notifications matching |profile|. Returns true if any were removed. 50 // Removes notifications matching |profile|. Returns true if any were removed.
44 virtual bool CancelAllByProfile(Profile* profile) = 0; 51 virtual bool CancelAllByProfile(Profile* profile) = 0;
45 52
46 // Cancels all pending notifications and closes anything currently showing. 53 // Cancels all pending notifications and closes anything currently showing.
47 // Used when the app is terminating. 54 // Used when the app is terminating.
48 virtual void CancelAll() = 0; 55 virtual void CancelAll() = 0;
49 56
50 // Temporary, while we have two implementations of Notifications UI Managers. 57 // Temporary, while we have two implementations of Notifications UI Managers.
51 // One is older BalloonCollection-based and uses renderers to show 58 // One is older BalloonCollection-based and uses renderers to show
52 // notifications, another delegates to the new MessageCenter and uses native 59 // notifications, another delegates to the new MessageCenter and uses native
53 // UI widgets. 60 // UI widgets.
54 // TODO(dimich): remove these eventually. 61 // TODO(dimich): remove these eventually.
55 static bool DelegatesToMessageCenter(); 62 static bool DelegatesToMessageCenter();
56 63
57 protected: 64 protected:
58 NotificationUIManager() {} 65 NotificationUIManager() {}
59 66
60 private: 67 private:
61 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); 68 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager);
62 }; 69 };
63 70
64 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ 71 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698