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

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

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

Powered by Google App Engine
This is Rietveld 408576698