OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // MediaControls implementation. | 77 // MediaControls implementation. |
78 void Show() override; | 78 void Show() override; |
79 void Hide() override; | 79 void Hide() override; |
80 void Reset() override; | 80 void Reset() override; |
81 void OnControlsListUpdated() override; | 81 void OnControlsListUpdated() override; |
82 // TODO(mlamouri): this is temporary to notify the controls that an | 82 // TODO(mlamouri): this is temporary to notify the controls that an |
83 // HTMLTrackElement failed to load because there is no web exposed way to | 83 // HTMLTrackElement failed to load because there is no web exposed way to |
84 // be notified on the TextTrack object. See https://crbug.com/669977 | 84 // be notified on the TextTrack object. See https://crbug.com/669977 |
85 void OnTrackElementFailedToLoad() override { OnTextTracksAddedOrRemoved(); } | 85 void OnTrackElementFailedToLoad() override { OnTextTracksAddedOrRemoved(); } |
86 // TODO(mlamouri): the following methods will be able to become private when | |
87 // the controls have to modules/ and have access to RemotePlayback. | |
88 void OnRemotePlaybackAvailabilityChanged() override { | |
89 RefreshCastButtonVisibility(); | |
90 } | |
91 void OnRemotePlaybackConnecting() override { StartedCasting(); } | |
92 void OnRemotePlaybackDisconnected() override { StoppedCasting(); } | |
93 // TODO(mlamouri): this method is needed in order to notify the controls that | 86 // TODO(mlamouri): this method is needed in order to notify the controls that |
94 // the attribute have changed. | 87 // the attribute have changed. |
95 void OnDisableRemotePlaybackAttributeChanged() override { | 88 void OnDisableRemotePlaybackAttributeChanged() override { |
96 RefreshCastButtonVisibility(); | 89 RefreshCastButtonVisibility(); |
97 } | 90 } |
98 // Notify us that the media element's network state has changed. | 91 // Notify us that the media element's network state has changed. |
99 void NetworkStateChanged() override; | 92 void NetworkStateChanged() override; |
100 LayoutObject* PanelLayoutObject() override; | 93 LayoutObject* PanelLayoutObject() override; |
101 LayoutObject* ContainerLayoutObject() override; | 94 LayoutObject* ContainerLayoutObject() override; |
102 // Return the internal elements, which is used by registering clicking | 95 // Return the internal elements, which is used by registering clicking |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // current. | 182 // current. |
190 void ComputeWhichControlsFit(); | 183 void ComputeWhichControlsFit(); |
191 | 184 |
192 // Node | 185 // Node |
193 bool IsMediaControls() const override { return true; } | 186 bool IsMediaControls() const override { return true; } |
194 bool WillRespondToMouseMoveEvents() override { return true; } | 187 bool WillRespondToMouseMoveEvents() override { return true; } |
195 void DefaultEventHandler(Event*) override; | 188 void DefaultEventHandler(Event*) override; |
196 bool ContainsRelatedTarget(Event*); | 189 bool ContainsRelatedTarget(Event*); |
197 | 190 |
198 // Internal cast related methods. | 191 // Internal cast related methods. |
199 void StartedCasting(); | |
200 void StoppedCasting(); | |
201 void RefreshCastButtonVisibility(); | 192 void RefreshCastButtonVisibility(); |
202 void RefreshCastButtonVisibilityWithoutUpdate(); | 193 void RefreshCastButtonVisibilityWithoutUpdate(); |
203 | 194 |
204 // Methods called by MediaControlsMediaEventListener. | 195 // Methods called by MediaControlsMediaEventListener. |
205 void OnVolumeChange(); | 196 void OnVolumeChange(); |
206 void OnFocusIn(); | 197 void OnFocusIn(); |
207 void OnTimeUpdate(); | 198 void OnTimeUpdate(); |
208 void OnDurationChange(); | 199 void OnDurationChange(); |
209 void OnPlay(); | 200 void OnPlay(); |
210 void OnPlaying(); | 201 void OnPlaying(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 IntSize size_; | 247 IntSize size_; |
257 | 248 |
258 bool keep_showing_until_timer_fires_ : 1; | 249 bool keep_showing_until_timer_fires_ : 1; |
259 }; | 250 }; |
260 | 251 |
261 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); | 252 DEFINE_ELEMENT_TYPE_CASTS(MediaControlsImpl, IsMediaControls()); |
262 | 253 |
263 } // namespace blink | 254 } // namespace blink |
264 | 255 |
265 #endif | 256 #endif |
OLD | NEW |