| OLD | NEW |
| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 #endif | 273 #endif |
| 274 | 274 |
| 275 void parseAttribute(const QualifiedName&, const AtomicString&) override; | 275 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
| 276 void finishParsingChildren() final; | 276 void finishParsingChildren() final; |
| 277 bool isURLAttribute(const Attribute&) const override; | 277 bool isURLAttribute(const Attribute&) const override; |
| 278 void attach(const AttachContext& = AttachContext()) override; | 278 void attach(const AttachContext& = AttachContext()) override; |
| 279 | 279 |
| 280 void didMoveToNewDocument(Document& oldDocument) override; | 280 void didMoveToNewDocument(Document& oldDocument) override; |
| 281 virtual KURL posterImageURL() const { return KURL(); } | 281 virtual KURL posterImageURL() const { return KURL(); } |
| 282 | 282 |
| 283 enum DisplayMode { Unknown, Poster, Video }; | 283 virtual void setShowPoster(bool showPoster) { } |
| 284 DisplayMode displayMode() const { return m_displayMode; } | |
| 285 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | |
| 286 | 284 |
| 287 void setControllerInternal(MediaController*); | 285 void setControllerInternal(MediaController*); |
| 288 | 286 |
| 289 private: | 287 private: |
| 290 void resetMediaPlayerAndMediaSource(); | 288 void resetMediaPlayerAndMediaSource(); |
| 291 | 289 |
| 292 bool alwaysCreateUserAgentShadowRoot() const final { return true; } | 290 bool alwaysCreateUserAgentShadowRoot() const final { return true; } |
| 293 bool areAuthorShadowsAllowed() const final { return false; } | 291 bool areAuthorShadowsAllowed() const final { return false; } |
| 294 | 292 |
| 295 bool supportsFocus() const final; | 293 bool supportsFocus() const final; |
| 296 bool isMouseFocusable() const final; | 294 bool isMouseFocusable() const final; |
| 297 bool layoutObjectIsNeeded(const ComputedStyle&) override; | 295 bool layoutObjectIsNeeded(const ComputedStyle&) override; |
| 298 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 296 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
| 299 InsertionNotificationRequest insertedInto(ContainerNode*) final; | 297 InsertionNotificationRequest insertedInto(ContainerNode*) final; |
| 300 void didNotifySubtreeInsertionsToDocument() override; | 298 void didNotifySubtreeInsertionsToDocument() override; |
| 301 void removedFrom(ContainerNode*) final; | 299 void removedFrom(ContainerNode*) final; |
| 302 void didRecalcStyle(StyleRecalcChange) final; | 300 void didRecalcStyle(StyleRecalcChange) final; |
| 303 | 301 |
| 304 bool canStartSelection() const override { return false; } | 302 bool canStartSelection() const override { return false; } |
| 305 | 303 |
| 306 void didBecomeFullscreenElement() final; | 304 void didBecomeFullscreenElement() final; |
| 307 void willStopBeingFullscreenElement() final; | 305 void willStopBeingFullscreenElement() final; |
| 308 bool isInteractiveContent() const final; | 306 bool isInteractiveContent() const final; |
| 309 void defaultEventHandler(Event*) final; | 307 void defaultEventHandler(Event*) final; |
| 310 | 308 |
| 311 // ActiveDOMObject functions. | 309 // ActiveDOMObject functions. |
| 312 void stop() final; | 310 void stop() final; |
| 313 | 311 |
| 314 virtual void updateDisplayState() { } | 312 virtual void updateDisplayState(bool forceUpdate) { } |
| 315 | 313 |
| 316 void setReadyState(ReadyState); | 314 void setReadyState(ReadyState); |
| 317 void setNetworkState(WebMediaPlayer::NetworkState); | 315 void setNetworkState(WebMediaPlayer::NetworkState); |
| 318 | 316 |
| 319 // WebMediaPlayerClient implementation. | 317 // WebMediaPlayerClient implementation. |
| 320 void networkStateChanged() final; | 318 void networkStateChanged() final; |
| 321 void readyStateChanged() final; | 319 void readyStateChanged() final; |
| 322 void timeChanged() final; | 320 void timeChanged() final; |
| 323 void repaint() final; | 321 void repaint() final; |
| 324 void durationChanged() final; | 322 void durationChanged() final; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // The load is deferred, and waiting for the task to set the | 511 // The load is deferred, and waiting for the task to set the |
| 514 // delaying-the-load-event flag, after which the load will be executed. | 512 // delaying-the-load-event flag, after which the load will be executed. |
| 515 ExecuteOnStopDelayingLoadEventTask | 513 ExecuteOnStopDelayingLoadEventTask |
| 516 }; | 514 }; |
| 517 DeferredLoadState m_deferredLoadState; | 515 DeferredLoadState m_deferredLoadState; |
| 518 Timer<HTMLMediaElement> m_deferredLoadTimer; | 516 Timer<HTMLMediaElement> m_deferredLoadTimer; |
| 519 | 517 |
| 520 OwnPtr<WebMediaPlayer> m_webMediaPlayer; | 518 OwnPtr<WebMediaPlayer> m_webMediaPlayer; |
| 521 WebLayer* m_webLayer; | 519 WebLayer* m_webLayer; |
| 522 | 520 |
| 523 DisplayMode m_displayMode; | |
| 524 | |
| 525 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource; | 521 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource; |
| 526 | 522 |
| 527 // Cached time value. Only valid when ready state is HAVE_METADATA or | 523 // Cached time value. Only valid when ready state is HAVE_METADATA or |
| 528 // higher, otherwise the current time is assumed to be zero. | 524 // higher, otherwise the current time is assumed to be zero. |
| 529 mutable double m_cachedTime; | 525 mutable double m_cachedTime; |
| 530 | 526 |
| 531 double m_fragmentEndTime; | 527 double m_fragmentEndTime; |
| 532 | 528 |
| 533 typedef unsigned PendingActionFlags; | 529 typedef unsigned PendingActionFlags; |
| 534 PendingActionFlags m_pendingActionFlags; | 530 PendingActionFlags m_pendingActionFlags; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 inline bool isHTMLMediaElement(const HTMLElement& element) | 640 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 645 { | 641 { |
| 646 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 642 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 647 } | 643 } |
| 648 | 644 |
| 649 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 645 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 650 | 646 |
| 651 } // namespace blink | 647 } // namespace blink |
| 652 | 648 |
| 653 #endif // HTMLMediaElement_h | 649 #endif // HTMLMediaElement_h |
| OLD | NEW |