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

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

Issue 1071773003: Remove persistent notifications from the database when they close. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-Integrate
Patch Set: rebase Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 22 matching lines...) Expand all
33 static PlatformNotificationServiceImpl* GetInstance(); 33 static PlatformNotificationServiceImpl* GetInstance();
34 34
35 // To be called when a persistent notification has been clicked on. The 35 // To be called when a persistent notification has been clicked on. The
36 // Service Worker associated with the registration will be started if 36 // Service Worker associated with the registration will be started if
37 // needed, on which the event will be fired. Must be called on the UI thread. 37 // needed, on which the event will be fired. Must be called on the UI thread.
38 void OnPersistentNotificationClick( 38 void OnPersistentNotificationClick(
39 content::BrowserContext* browser_context, 39 content::BrowserContext* browser_context,
40 int64_t persistent_notification_id, 40 int64_t persistent_notification_id,
41 const GURL& origin) const; 41 const GURL& origin) const;
42 42
43 // To be called when a persistent notification has been closed. The data
44 // associated with the notification has to be pruned from the database in this
45 // case, to make sure that it continues to be in sync. Must be called on the
46 // UI thread.
47 void OnPersistentNotificationClose(
48 content::BrowserContext* browser_context,
49 int64_t persistent_notification_id,
50 const GURL& origin) const;
51
43 // Returns the Notification UI Manager through which notifications can be 52 // Returns the Notification UI Manager through which notifications can be
44 // displayed to the user. Can be overridden for testing. 53 // displayed to the user. Can be overridden for testing.
45 NotificationUIManager* GetNotificationUIManager() const; 54 NotificationUIManager* GetNotificationUIManager() const;
46 55
47 // content::PlatformNotificationService implementation. 56 // content::PlatformNotificationService implementation.
48 blink::WebNotificationPermission CheckPermissionOnUIThread( 57 blink::WebNotificationPermission CheckPermissionOnUIThread(
49 content::BrowserContext* browser_context, 58 content::BrowserContext* browser_context,
50 const GURL& origin, 59 const GURL& origin,
51 int render_process_id) override; 60 int render_process_id) override;
52 blink::WebNotificationPermission CheckPermissionOnIOThread( 61 blink::WebNotificationPermission CheckPermissionOnIOThread(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 NotificationUIManager* notification_ui_manager_for_tests_; 123 NotificationUIManager* notification_ui_manager_for_tests_;
115 124
116 // Mapping between a persistent notification id and the id of the associated 125 // Mapping between a persistent notification id and the id of the associated
117 // message_center::Notification object. Must only be used on the UI thread. 126 // message_center::Notification object. Must only be used on the UI thread.
118 std::map<int64_t, std::string> persistent_notifications_; 127 std::map<int64_t, std::string> persistent_notifications_;
119 128
120 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); 129 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl);
121 }; 130 };
122 131
123 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 132 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698