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

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

Issue 1297983002: Update poster code as per https://html.spec.whatwg.org/#show-poster-flag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: clean up Created 5 years, 2 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
« no previous file with comments | « no previous file | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 #endif 270 #endif
271 271
272 void parseAttribute(const QualifiedName&, const AtomicString&) override; 272 void parseAttribute(const QualifiedName&, const AtomicString&) override;
273 void finishParsingChildren() final; 273 void finishParsingChildren() final;
274 bool isURLAttribute(const Attribute&) const override; 274 bool isURLAttribute(const Attribute&) const override;
275 void attach(const AttachContext& = AttachContext()) override; 275 void attach(const AttachContext& = AttachContext()) override;
276 276
277 void didMoveToNewDocument(Document& oldDocument) override; 277 void didMoveToNewDocument(Document& oldDocument) override;
278 virtual KURL posterImageURL() const { return KURL(); } 278 virtual KURL posterImageURL() const { return KURL(); }
279 279
280 enum DisplayMode { Unknown, Poster, Video }; 280 virtual void setShowPoster(bool showPoster) { }
281 DisplayMode displayMode() const { return m_displayMode; }
282 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
283 281
284 void setControllerInternal(MediaController*); 282 void setControllerInternal(MediaController*);
285 283
286 private: 284 private:
287 void resetMediaPlayerAndMediaSource(); 285 void resetMediaPlayerAndMediaSource();
288 286
289 bool alwaysCreateUserAgentShadowRoot() const final { return true; } 287 bool alwaysCreateUserAgentShadowRoot() const final { return true; }
290 bool areAuthorShadowsAllowed() const final { return false; } 288 bool areAuthorShadowsAllowed() const final { return false; }
291 289
292 bool supportsFocus() const final; 290 bool supportsFocus() const final;
293 bool isMouseFocusable() const final; 291 bool isMouseFocusable() const final;
294 bool layoutObjectIsNeeded(const ComputedStyle&) override; 292 bool layoutObjectIsNeeded(const ComputedStyle&) override;
295 LayoutObject* createLayoutObject(const ComputedStyle&) override; 293 LayoutObject* createLayoutObject(const ComputedStyle&) override;
296 InsertionNotificationRequest insertedInto(ContainerNode*) final; 294 InsertionNotificationRequest insertedInto(ContainerNode*) final;
297 void didNotifySubtreeInsertionsToDocument() override; 295 void didNotifySubtreeInsertionsToDocument() override;
298 void removedFrom(ContainerNode*) final; 296 void removedFrom(ContainerNode*) final;
299 void didRecalcStyle(StyleRecalcChange) final; 297 void didRecalcStyle(StyleRecalcChange) final;
300 298
301 bool canStartSelection() const override { return false; } 299 bool canStartSelection() const override { return false; }
302 300
303 void didBecomeFullscreenElement() final; 301 void didBecomeFullscreenElement() final;
304 void willStopBeingFullscreenElement() final; 302 void willStopBeingFullscreenElement() final;
305 bool isInteractiveContent() const final; 303 bool isInteractiveContent() const final;
306 void defaultEventHandler(Event*) final; 304 void defaultEventHandler(Event*) final;
307 305
308 // ActiveDOMObject functions. 306 // ActiveDOMObject functions.
309 void stop() final; 307 void stop() final;
310 308
311 virtual void updateDisplayState() { } 309 virtual void updateDisplayState(bool forceUpdate) { }
312 310
313 void setReadyState(ReadyState); 311 void setReadyState(ReadyState);
314 void setNetworkState(WebMediaPlayer::NetworkState); 312 void setNetworkState(WebMediaPlayer::NetworkState);
315 313
316 // WebMediaPlayerClient implementation. 314 // WebMediaPlayerClient implementation.
317 void networkStateChanged() final; 315 void networkStateChanged() final;
318 void readyStateChanged() final; 316 void readyStateChanged() final;
319 void timeChanged() final; 317 void timeChanged() final;
320 void repaint() final; 318 void repaint() final;
321 void durationChanged() final; 319 void durationChanged() final;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // The load is deferred, and waiting for the task to set the 494 // The load is deferred, and waiting for the task to set the
497 // delaying-the-load-event flag, after which the load will be executed. 495 // delaying-the-load-event flag, after which the load will be executed.
498 ExecuteOnStopDelayingLoadEventTask 496 ExecuteOnStopDelayingLoadEventTask
499 }; 497 };
500 DeferredLoadState m_deferredLoadState; 498 DeferredLoadState m_deferredLoadState;
501 Timer<HTMLMediaElement> m_deferredLoadTimer; 499 Timer<HTMLMediaElement> m_deferredLoadTimer;
502 500
503 OwnPtr<WebMediaPlayer> m_webMediaPlayer; 501 OwnPtr<WebMediaPlayer> m_webMediaPlayer;
504 WebLayer* m_webLayer; 502 WebLayer* m_webLayer;
505 503
506 DisplayMode m_displayMode;
507
508 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource; 504 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource;
509 505
510 // Cached time value. Only valid when ready state is HAVE_METADATA or 506 // Cached time value. Only valid when ready state is HAVE_METADATA or
511 // higher, otherwise the current time is assumed to be zero. 507 // higher, otherwise the current time is assumed to be zero.
512 mutable double m_cachedTime; 508 mutable double m_cachedTime;
513 509
514 double m_fragmentEndTime; 510 double m_fragmentEndTime;
515 511
516 typedef unsigned PendingActionFlags; 512 typedef unsigned PendingActionFlags;
517 PendingActionFlags m_pendingActionFlags; 513 PendingActionFlags m_pendingActionFlags;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 inline bool isHTMLMediaElement(const HTMLElement& element) 620 inline bool isHTMLMediaElement(const HTMLElement& element)
625 { 621 {
626 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 622 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
627 } 623 }
628 624
629 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 625 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
630 626
631 } // namespace blink 627 } // namespace blink
632 628
633 #endif // HTMLMediaElement_h 629 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698