Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 2767823002: Media Remoting: Add interstitial elements to media element shadow dom. (Closed)
Patch Set: Modified disable button. Added cast icon and message. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class CueTimeline; 56 class CueTimeline;
57 class ElementVisibilityObserver; 57 class ElementVisibilityObserver;
58 class EnumerationHistogram; 58 class EnumerationHistogram;
59 class Event; 59 class Event;
60 class ExceptionState; 60 class ExceptionState;
61 class HTMLSourceElement; 61 class HTMLSourceElement;
62 class HTMLTrackElement; 62 class HTMLTrackElement;
63 class KURL; 63 class KURL;
64 class MediaControls; 64 class MediaControls;
65 class MediaError; 65 class MediaError;
66 class MediaRemotingInterstitial;
66 class MediaStreamDescriptor; 67 class MediaStreamDescriptor;
67 class HTMLMediaSource; 68 class HTMLMediaSource;
68 class ScriptState; 69 class ScriptState;
69 class TextTrackContainer; 70 class TextTrackContainer;
70 class TextTrackList; 71 class TextTrackList;
71 class TimeRanges; 72 class TimeRanges;
72 class URLRegistry; 73 class URLRegistry;
73 class VideoTrack; 74 class VideoTrack;
74 class VideoTrackList; 75 class VideoTrackList;
75 class WebAudioSourceProvider; 76 class WebAudioSourceProvider;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 317
317 void videoWillBeDrawnToCanvas() const; 318 void videoWillBeDrawnToCanvas() const;
318 319
319 WebRemotePlaybackClient* remotePlaybackClient() { 320 WebRemotePlaybackClient* remotePlaybackClient() {
320 return m_remotePlaybackClient; 321 return m_remotePlaybackClient;
321 } 322 }
322 const WebRemotePlaybackClient* remotePlaybackClient() const { 323 const WebRemotePlaybackClient* remotePlaybackClient() const {
323 return m_remotePlaybackClient; 324 return m_remotePlaybackClient;
324 } 325 }
325 326
327 void disableMediaRemoting();
328
326 protected: 329 protected:
327 HTMLMediaElement(const QualifiedName&, Document&); 330 HTMLMediaElement(const QualifiedName&, Document&);
328 ~HTMLMediaElement() override; 331 ~HTMLMediaElement() override;
329 void dispose(); 332 void dispose();
330 333
331 void parseAttribute(const AttributeModificationParams&) override; 334 void parseAttribute(const AttributeModificationParams&) override;
332 void finishParsingChildren() final; 335 void finishParsingChildren() final;
333 bool isURLAttribute(const Attribute&) const override; 336 bool isURLAttribute(const Attribute&) const override;
334 void attachLayoutTree(const AttachContext& = AttachContext()) override; 337 void attachLayoutTree(const AttachContext& = AttachContext()) override;
335 338
336 InsertionNotificationRequest insertedInto(ContainerNode*) override; 339 InsertionNotificationRequest insertedInto(ContainerNode*) override;
337 void removedFrom(ContainerNode*) override; 340 void removedFrom(ContainerNode*) override;
338 341
339 void didMoveToNewDocument(Document& oldDocument) override; 342 void didMoveToNewDocument(Document& oldDocument) override;
340 virtual KURL posterImageURL() const { return KURL(); } 343 virtual KURL posterImageURL() const { return KURL(); }
341 344
342 enum DisplayMode { Unknown, Poster, Video }; 345 enum DisplayMode { Unknown, Poster, Video };
343 DisplayMode getDisplayMode() const { return m_displayMode; } 346 DisplayMode getDisplayMode() const { return m_displayMode; }
344 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } 347 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
345 348
349 void onPosterImageChanged();
350
346 private: 351 private:
347 // Friend class for testing. 352 // Friend class for testing.
348 friend class MediaElementFillingViewportTest; 353 friend class MediaElementFillingViewportTest;
349 354
350 void resetMediaPlayerAndMediaSource(); 355 void resetMediaPlayerAndMediaSource();
351 356
352 bool alwaysCreateUserAgentShadowRoot() const final { return true; } 357 bool alwaysCreateUserAgentShadowRoot() const final { return true; }
353 bool areAuthorShadowsAllowed() const final { return false; } 358 bool areAuthorShadowsAllowed() const final { return false; }
354 359
355 bool supportsFocus() const final; 360 bool supportsFocus() const final;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 void connectedToRemoteDevice() final; 406 void connectedToRemoteDevice() final;
402 void disconnectedFromRemoteDevice() final; 407 void disconnectedFromRemoteDevice() final;
403 void cancelledRemotePlaybackRequest() final; 408 void cancelledRemotePlaybackRequest() final;
404 void remotePlaybackStarted() final; 409 void remotePlaybackStarted() final;
405 void onBecamePersistentVideo(bool) final; 410 void onBecamePersistentVideo(bool) final;
406 bool hasSelectedVideoTrack() final; 411 bool hasSelectedVideoTrack() final;
407 WebMediaPlayer::TrackId getSelectedVideoTrackId() final; 412 WebMediaPlayer::TrackId getSelectedVideoTrackId() final;
408 bool isAutoplayingMuted() final; 413 bool isAutoplayingMuted() final;
409 void requestReload(const WebURL&) final; 414 void requestReload(const WebURL&) final;
410 void activateViewportIntersectionMonitoring(bool) final; 415 void activateViewportIntersectionMonitoring(bool) final;
416 void mediaRemotingStarted() final;
417 void mediaRemotingStopped() final;
411 418
412 void loadTimerFired(TimerBase*); 419 void loadTimerFired(TimerBase*);
413 void progressEventTimerFired(TimerBase*); 420 void progressEventTimerFired(TimerBase*);
414 void playbackProgressTimerFired(TimerBase*); 421 void playbackProgressTimerFired(TimerBase*);
415 void checkViewportIntersectionTimerFired(TimerBase*); 422 void checkViewportIntersectionTimerFired(TimerBase*);
416 void startPlaybackProgressTimer(); 423 void startPlaybackProgressTimer();
417 void startProgressEventTimer(); 424 void startProgressEventTimer();
418 void stopPeriodicTimers(); 425 void stopPeriodicTimers();
419 426
420 void seek(double time); 427 void seek(double time);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 bool m_shouldPerformAutomaticTrackSelection : 1; 668 bool m_shouldPerformAutomaticTrackSelection : 1;
662 669
663 bool m_tracksAreReady : 1; 670 bool m_tracksAreReady : 1;
664 bool m_processingPreferenceChange : 1; 671 bool m_processingPreferenceChange : 1;
665 bool m_playingRemotely : 1; 672 bool m_playingRemotely : 1;
666 // Whether this element is in overlay fullscreen mode. 673 // Whether this element is in overlay fullscreen mode.
667 bool m_inOverlayFullscreenVideo : 1; 674 bool m_inOverlayFullscreenVideo : 1;
668 675
669 bool m_mostlyFillingViewport : 1; 676 bool m_mostlyFillingViewport : 1;
670 677
678 bool m_mediaRemotingDisabled : 1;
679
671 TraceWrapperMember<AudioTrackList> m_audioTracks; 680 TraceWrapperMember<AudioTrackList> m_audioTracks;
672 TraceWrapperMember<VideoTrackList> m_videoTracks; 681 TraceWrapperMember<VideoTrackList> m_videoTracks;
673 TraceWrapperMember<TextTrackList> m_textTracks; 682 TraceWrapperMember<TextTrackList> m_textTracks;
674 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; 683 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan;
675 684
676 Member<CueTimeline> m_cueTimeline; 685 Member<CueTimeline> m_cueTimeline;
677 686
678 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 687 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
679 TaskHandle m_playPromiseResolveTaskHandle; 688 TaskHandle m_playPromiseResolveTaskHandle;
680 TaskHandle m_playPromiseRejectTaskHandle; 689 TaskHandle m_playPromiseRejectTaskHandle;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 760
752 WebRemotePlaybackClient* m_remotePlaybackClient; 761 WebRemotePlaybackClient* m_remotePlaybackClient;
753 762
754 // class AutoplayVisibilityObserver; 763 // class AutoplayVisibilityObserver;
755 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; 764 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver;
756 765
757 IntRect m_currentIntersectRect; 766 IntRect m_currentIntersectRect;
758 767
759 Member<MediaControls> m_mediaControls; 768 Member<MediaControls> m_mediaControls;
760 Member<HTMLMediaElementControlsList> m_controlsList; 769 Member<HTMLMediaElementControlsList> m_controlsList;
770 Member<MediaRemotingInterstitial> m_remotingInterstitial;
761 771
762 bool m_isPersistentVideo; 772 bool m_isPersistentVideo;
763 773
764 static URLRegistry* s_mediaStreamRegistry; 774 static URLRegistry* s_mediaStreamRegistry;
765 }; 775 };
766 776
767 inline bool isHTMLMediaElement(const HTMLElement& element) { 777 inline bool isHTMLMediaElement(const HTMLElement& element) {
768 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 778 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
769 } 779 }
770 780
771 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 781 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
772 782
773 } // namespace blink 783 } // namespace blink
774 784
775 #endif // HTMLMediaElement_h 785 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698