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

Side by Side Diff: chrome/common/desktop_notifications/active_notification_tracker.h

Issue 549140: If a page is navigated within the same render process, the active notificatio... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 11 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
« no previous file with comments | « no previous file | chrome/common/desktop_notifications/active_notification_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_ 5 #ifndef CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
6 #define CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_ 6 #define CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 17 matching lines...) Expand all
28 void UnregisterNotification(int id); 28 void UnregisterNotification(int id);
29 bool GetId(const WebKit::WebNotification& notification, int& id); 29 bool GetId(const WebKit::WebNotification& notification, int& id);
30 bool GetNotification(int id, WebKit::WebNotification* notification); 30 bool GetNotification(int id, WebKit::WebNotification* notification);
31 31
32 // Methods for tracking active permission requests. 32 // Methods for tracking active permission requests.
33 int RegisterPermissionRequest( 33 int RegisterPermissionRequest(
34 WebKit::WebNotificationPermissionCallback* callback); 34 WebKit::WebNotificationPermissionCallback* callback);
35 void OnPermissionRequestComplete(int id); 35 void OnPermissionRequestComplete(int id);
36 WebKit::WebNotificationPermissionCallback* GetCallback(int id); 36 WebKit::WebNotificationPermissionCallback* GetCallback(int id);
37 37
38 // Clears out all active notifications. Useful on page navigation.
39 void Clear();
40
38 private: 41 private:
39 typedef std::map<WebKit::WebNotification, int> ReverseTable; 42 typedef std::map<WebKit::WebNotification, int> ReverseTable;
40 43
41 // Tracking maps for active notifications and permission requests. 44 // Tracking maps for active notifications and permission requests.
42 IDMap<WebKit::WebNotification> notification_table_; 45 IDMap<WebKit::WebNotification> notification_table_;
43 ReverseTable reverse_notification_table_; 46 ReverseTable reverse_notification_table_;
44 IDMap<WebKit::WebNotificationPermissionCallback> callback_table_; 47 IDMap<WebKit::WebNotificationPermissionCallback> callback_table_;
45 48
46 DISALLOW_COPY_AND_ASSIGN(ActiveNotificationTracker); 49 DISALLOW_COPY_AND_ASSIGN(ActiveNotificationTracker);
47 }; 50 };
48 51
49 #endif // CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_ 52 #endif // CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
50
OLDNEW
« no previous file with comments | « no previous file | chrome/common/desktop_notifications/active_notification_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698