| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 module content.mojom; | 5 module content.mojom; |
| 6 | 6 |
| 7 import "url/mojo/url.mojom"; | 7 import "url/mojo/url.mojom"; |
| 8 | 8 |
| 9 // TODO(heke): The type-mapping struct and enums are duplicately defined. Need | 9 // TODO(heke): The type-mapping struct and enums are duplicately defined. Need |
| 10 // to remove/replace those defined in content or blink namespace. | 10 // to remove/replace those defined in content or blink namespace. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 enum PushPermissionStatus { | 136 enum PushPermissionStatus { |
| 137 GRANTED = 0, | 137 GRANTED = 0, |
| 138 DENIED = 1, | 138 DENIED = 1, |
| 139 PROMPT = 2, | 139 PROMPT = 2, |
| 140 LAST = PROMPT | 140 LAST = PROMPT |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 interface PushMessaging { | 143 interface PushMessaging { |
| 144 Subscribe(int32 render_frame_id, | 144 Subscribe(int32 render_frame_id, |
| 145 int64 service_worker_registration_id, | 145 int64 service_worker_registration_id, |
| 146 PushSubscriptionOptions options) | 146 PushSubscriptionOptions options, |
| 147 bool user_gesture) |
| 147 => (PushRegistrationStatus status, | 148 => (PushRegistrationStatus status, |
| 148 url.mojom.Url? endpoint, | 149 url.mojom.Url? endpoint, |
| 149 PushSubscriptionOptions? options, | 150 PushSubscriptionOptions? options, |
| 150 array<uint8>? p256dh, | 151 array<uint8>? p256dh, |
| 151 array<uint8>? auth); | 152 array<uint8>? auth); |
| 152 | 153 |
| 153 // We use the value of |error_type| as a flag. If |error_type| == NONE, it | 154 // We use the value of |error_type| as a flag. If |error_type| == NONE, it |
| 154 // means no error and returns |did_unsubscribe|. Else, it means there is an | 155 // means no error and returns |did_unsubscribe|. Else, it means there is an |
| 155 // error and returns |error_type| and |error_message|. | 156 // error and returns |error_type| and |error_message|. |
| 156 Unsubscribe(int64 service_worker_registration_id) | 157 Unsubscribe(int64 service_worker_registration_id) |
| 157 => (PushErrorType error_type, | 158 => (PushErrorType error_type, |
| 158 bool did_unsubscribe, | 159 bool did_unsubscribe, |
| 159 string? error_message); | 160 string? error_message); |
| 160 | 161 |
| 161 GetSubscription(int64 service_worker_registration_id) | 162 GetSubscription(int64 service_worker_registration_id) |
| 162 => (PushGetRegistrationStatus status, | 163 => (PushGetRegistrationStatus status, |
| 163 url.mojom.Url? endpoint, | 164 url.mojom.Url? endpoint, |
| 164 PushSubscriptionOptions? options, | 165 PushSubscriptionOptions? options, |
| 165 array<uint8>? p256dh, | 166 array<uint8>? p256dh, |
| 166 array<uint8>? auth); | 167 array<uint8>? auth); |
| 167 | 168 |
| 168 // We use the value of |error_type| as a flag. If |error_type| == NONE, it | 169 // We use the value of |error_type| as a flag. If |error_type| == NONE, it |
| 169 // means no error and returns |status|. Else, it means there is an error and | 170 // means no error and returns |status|. Else, it means there is an error and |
| 170 // returns |error_type|. | 171 // returns |error_type|. |
| 171 GetPermissionStatus(int64 service_worker_registration_id, | 172 GetPermissionStatus(int64 service_worker_registration_id, |
| 172 bool user_visible) | 173 bool user_visible) |
| 173 => (PushErrorType error_type, | 174 => (PushErrorType error_type, |
| 174 PushPermissionStatus status); | 175 PushPermissionStatus status); |
| 175 }; | 176 }; |
| OLD | NEW |