| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/push_messaging/PushManager.h" | 6 #include "modules/push_messaging/PushManager.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 WebPushProvider* webPushProvider = Platform::current()->pushProvider(); | 34 WebPushProvider* webPushProvider = Platform::current()->pushProvider(); |
| 35 ASSERT(webPushProvider); | 35 ASSERT(webPushProvider); |
| 36 return webPushProvider; | 36 return webPushProvider; |
| 37 } | 37 } |
| 38 | 38 |
| 39 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp
tions& options) | 39 WebPushSubscriptionOptions toWebPushSubscriptionOptions(const PushSubscriptionOp
tions& options) |
| 40 { | 40 { |
| 41 WebPushSubscriptionOptions webOptions; | 41 WebPushSubscriptionOptions webOptions; |
| 42 webOptions.userVisibleOnly = options.userVisibleOnly(); | 42 webOptions.userVisibleOnly = options.userVisibleOnly(); |
| 43 | 43 |
| 44 // Backfill userVisible since it's still used by the chrome layer. |
| 45 webOptions.userVisible = options.userVisibleOnly(); |
| 44 return webOptions; | 46 return webOptions; |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace | 49 } // namespace |
| 48 | 50 |
| 49 PushManager::PushManager(ServiceWorkerRegistration* registration) | 51 PushManager::PushManager(ServiceWorkerRegistration* registration) |
| 50 : m_registration(registration) | 52 : m_registration(registration) |
| 51 { | 53 { |
| 52 ASSERT(registration); | 54 ASSERT(registration); |
| 53 } | 55 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb
PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver)); | 102 pushProvider()->getPermissionStatus(m_registration->webRegistration(), toWeb
PushSubscriptionOptions(options), new PushPermissionStatusCallbacks(resolver)); |
| 101 return promise; | 103 return promise; |
| 102 } | 104 } |
| 103 | 105 |
| 104 DEFINE_TRACE(PushManager) | 106 DEFINE_TRACE(PushManager) |
| 105 { | 107 { |
| 106 visitor->trace(m_registration); | 108 visitor->trace(m_registration); |
| 107 } | 109 } |
| 108 | 110 |
| 109 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |