OLD | NEW |
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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // Checks the permission status for the requesting origin. Permission is only | 71 // Checks the permission status for the requesting origin. Permission is only |
72 // ever granted when the requesting origin matches the top level embedding | 72 // ever granted when the requesting origin matches the top level embedding |
73 // origin. The |user_visible| boolean indicates whether the permission status | 73 // origin. The |user_visible| boolean indicates whether the permission status |
74 // only has to cover push messages resulting in visible effects to the user. | 74 // only has to cover push messages resulting in visible effects to the user. |
75 virtual blink::WebPushPermissionStatus GetPermissionStatus( | 75 virtual blink::WebPushPermissionStatus GetPermissionStatus( |
76 const GURL& requesting_origin, | 76 const GURL& requesting_origin, |
77 const GURL& embedding_origin, | 77 const GURL& embedding_origin, |
78 bool user_visible) = 0; | 78 bool user_visible) = 0; |
79 | 79 |
| 80 // Returns whether subscriptions that do not mandate user visible UI upon |
| 81 // receiving a push message are supported. Influences permission request and |
| 82 // permission check behaviour. |
| 83 virtual bool SupportNonVisibleMessages() = 0; |
| 84 |
80 // Provide a storage mechanism to read/write an opaque | 85 // Provide a storage mechanism to read/write an opaque |
81 // "notifications_shown_by_last_few_pushes" string associated with a Service | 86 // "notifications_shown_by_last_few_pushes" string associated with a Service |
82 // Worker registration. Stored data is deleted when the associated | 87 // Worker registration. Stored data is deleted when the associated |
83 // registration is deleted. | 88 // registration is deleted. |
84 static void GetNotificationsShownByLastFewPushes( | 89 static void GetNotificationsShownByLastFewPushes( |
85 ServiceWorkerContext* service_worker_context, | 90 ServiceWorkerContext* service_worker_context, |
86 int64 service_worker_registration_id, | 91 int64 service_worker_registration_id, |
87 const StringCallback& callback); | 92 const StringCallback& callback); |
88 static void SetNotificationsShownByLastFewPushes( | 93 static void SetNotificationsShownByLastFewPushes( |
89 ServiceWorkerContext* service_worker_context, | 94 ServiceWorkerContext* service_worker_context, |
(...skipping 12 matching lines...) Expand all Loading... |
102 // |service_worker_registration_id| for the given |origin|. | 107 // |service_worker_registration_id| for the given |origin|. |
103 static void ClearPushRegistrationID(BrowserContext* browser_context, | 108 static void ClearPushRegistrationID(BrowserContext* browser_context, |
104 const GURL& origin, | 109 const GURL& origin, |
105 int64 service_worker_registration_id, | 110 int64 service_worker_registration_id, |
106 const base::Closure& callback); | 111 const base::Closure& callback); |
107 }; | 112 }; |
108 | 113 |
109 } // namespace content | 114 } // namespace content |
110 | 115 |
111 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ | 116 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ |
OLD | NEW |