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

Side by Side Diff: content/public/browser/push_messaging_service.h

Issue 1851423003: Make Web Push use InstanceID tokens instead of GCM registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid4default
Patch Set: Fix GN/GYP Created 4 years, 8 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 CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // associated to |origin| and |service_worker_registration_id|. 72 // associated to |origin| and |service_worker_registration_id|.
73 virtual void GetEncryptionInfo(const GURL& origin, 73 virtual void GetEncryptionInfo(const GURL& origin,
74 int64_t service_worker_registration_id, 74 int64_t service_worker_registration_id,
75 const EncryptionInfoCallback& callback) = 0; 75 const EncryptionInfoCallback& callback) = 0;
76 76
77 // Unsubscribe the given |sender_id| from the push messaging service. The 77 // Unsubscribe the given |sender_id| from the push messaging service. The
78 // subscription will be synchronously deactivated locally, and asynchronously 78 // subscription will be synchronously deactivated locally, and asynchronously
79 // sent to the push service, with automatic retry. 79 // sent to the push service, with automatic retry.
80 virtual void Unsubscribe(const GURL& requesting_origin, 80 virtual void Unsubscribe(const GURL& requesting_origin,
81 int64_t service_worker_registration_id, 81 int64_t service_worker_registration_id,
82 const std::string& sender_id,
83 const UnregisterCallback& callback) = 0; 82 const UnregisterCallback& callback) = 0;
84 83
85 // Checks the permission status for the |origin|. The |user_visible| boolean 84 // Checks the permission status for the |origin|. The |user_visible| boolean
86 // indicates whether the permission status only has to cover push messages 85 // indicates whether the permission status only has to cover push messages
87 // resulting in visible effects to the user. 86 // resulting in visible effects to the user.
88 virtual blink::WebPushPermissionStatus GetPermissionStatus( 87 virtual blink::WebPushPermissionStatus GetPermissionStatus(
89 const GURL& origin, 88 const GURL& origin,
90 bool user_visible) = 0; 89 bool user_visible) = 0;
91 90
92 // Returns whether subscriptions that do not mandate user visible UI upon 91 // Returns whether subscriptions that do not mandate user visible UI upon
(...skipping 10 matching lines...) Expand all
103 int64_t service_worker_registration_id, 102 int64_t service_worker_registration_id,
104 const StringCallback& callback); 103 const StringCallback& callback);
105 static void SetNotificationsShownByLastFewPushes( 104 static void SetNotificationsShownByLastFewPushes(
106 ServiceWorkerContext* service_worker_context, 105 ServiceWorkerContext* service_worker_context,
107 int64_t service_worker_registration_id, 106 int64_t service_worker_registration_id,
108 const GURL& origin, 107 const GURL& origin,
109 const std::string& notifications_shown, 108 const std::string& notifications_shown,
110 const ResultCallback& callback); 109 const ResultCallback& callback);
111 110
112 protected: 111 protected:
113 static void GetSenderId(BrowserContext* browser_context,
114 const GURL& origin,
115 int64_t service_worker_registration_id,
116 const StringCallback& callback);
117
118 // Clear the push subscription id stored in the service worker with the given 112 // Clear the push subscription id stored in the service worker with the given
119 // |service_worker_registration_id| for the given |origin|. 113 // |service_worker_registration_id| for the given |origin|.
120 static void ClearPushSubscriptionID(BrowserContext* browser_context, 114 static void ClearPushSubscriptionID(BrowserContext* browser_context,
121 const GURL& origin, 115 const GURL& origin,
122 int64_t service_worker_registration_id, 116 int64_t service_worker_registration_id,
123 const base::Closure& callback); 117 const base::Closure& callback);
124 }; 118 };
125 119
126 } // namespace content 120 } // namespace content
127 121
128 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ 122 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698