OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BluetoothSupplement_h |
| 6 #define BluetoothSupplement_h |
| 7 |
| 8 #include "core/frame/LocalFrame.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class WebBluetooth; |
| 13 |
| 14 // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to |
| 15 // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth |
| 16 // code in modules/. |
| 17 class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<Blu
etoothSupplement>, public WillBeHeapSupplement<LocalFrame> { |
| 18 WTF_MAKE_NONCOPYABLE(BluetoothSupplement); |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); |
| 20 |
| 21 public: |
| 22 static const char* supplementName(); |
| 23 |
| 24 static void provideTo(LocalFrame&, WebBluetooth*); |
| 25 |
| 26 // Returns the WebBluetooth attached to the ScriptState's frame if that exis
ts; |
| 27 // otherwise the Platform's WebBluetooth. |
| 28 static WebBluetooth* from(ScriptState*); |
| 29 |
| 30 DECLARE_VIRTUAL_TRACE(); |
| 31 |
| 32 private: |
| 33 explicit BluetoothSupplement(WebBluetooth*); |
| 34 |
| 35 WebBluetooth* m_bluetooth; |
| 36 }; |
| 37 |
| 38 } // namespace blink |
| 39 |
| 40 #endif // BluetoothRoutingId_h |
OLD | NEW |