| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 RemotePlayback_h | 5 #ifndef RemotePlayback_h |
| 6 #define RemotePlayback_h | 6 #define RemotePlayback_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Shows the UI allowing user to change the remote playback state of the media | 55 // Shows the UI allowing user to change the remote playback state of the media |
| 56 // element (by picking a remote playback device from the list, for example). | 56 // element (by picking a remote playback device from the list, for example). |
| 57 ScriptPromise prompt(ScriptState*); | 57 ScriptPromise prompt(ScriptState*); |
| 58 | 58 |
| 59 String state() const; | 59 String state() const; |
| 60 | 60 |
| 61 // ScriptWrappable implementation. | 61 // ScriptWrappable implementation. |
| 62 bool hasPendingActivity() const final; | 62 bool hasPendingActivity() const final; |
| 63 | 63 |
| 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(connecting); |
| 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); |
| 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); |
| 65 | 67 |
| 66 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 friend class RemotePlaybackTest; | 71 friend class RemotePlaybackTest; |
| 70 | 72 |
| 71 explicit RemotePlayback(HTMLMediaElement&); | 73 explicit RemotePlayback(HTMLMediaElement&); |
| 72 | 74 |
| 73 // Calls the specified availability callback with the current availability. | 75 // Calls the specified availability callback with the current availability. |
| 74 // Need a void() method to post it as a task. | 76 // Need a void() method to post it as a task. |
| 75 void notifyInitialAvailability(int callbackId); | 77 void notifyInitialAvailability(int callbackId); |
| 76 | 78 |
| 77 // WebRemotePlaybackClient implementation. | 79 // WebRemotePlaybackClient implementation. |
| 78 void stateChanged(WebRemotePlaybackState) override; | 80 void stateChanged(WebRemotePlaybackState) override; |
| 79 void availabilityChanged(bool available) override; | 81 void availabilityChanged(bool available) override; |
| 80 void promptCancelled() override; | 82 void promptCancelled() override; |
| 81 | 83 |
| 82 RefPtr<ScriptState> m_scriptState; | 84 RefPtr<ScriptState> m_scriptState; |
| 83 WebRemotePlaybackState m_state; | 85 WebRemotePlaybackState m_state; |
| 84 bool m_availability; | 86 bool m_availability; |
| 85 HeapHashMap<int, Member<RemotePlaybackAvailabilityCallback>> | 87 HeapHashMap<int, Member<RemotePlaybackAvailabilityCallback>> |
| 86 m_availabilityCallbacks; | 88 m_availabilityCallbacks; |
| 87 Member<HTMLMediaElement> m_mediaElement; | 89 Member<HTMLMediaElement> m_mediaElement; |
| 88 Member<ScriptPromiseResolver> m_promptPromiseResolver; | 90 Member<ScriptPromiseResolver> m_promptPromiseResolver; |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 } // namespace blink | 93 } // namespace blink |
| 92 | 94 |
| 93 #endif // RemotePlayback_h | 95 #endif // RemotePlayback_h |
| OLD | NEW |