| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 void didMoveToNewDocument(Document& oldDocument) override; | 291 void didMoveToNewDocument(Document& oldDocument) override; |
| 292 virtual KURL posterImageURL() const { return KURL(); } | 292 virtual KURL posterImageURL() const { return KURL(); } |
| 293 | 293 |
| 294 enum DisplayMode { Unknown, Poster, Video }; | 294 enum DisplayMode { Unknown, Poster, Video }; |
| 295 DisplayMode getDisplayMode() const { return m_displayMode; } | 295 DisplayMode getDisplayMode() const { return m_displayMode; } |
| 296 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 296 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
| 297 | 297 |
| 298 void recordAutoplayMetric(AutoplayMetrics); | 298 void recordAutoplayMetric(AutoplayMetrics); |
| 299 | 299 |
| 300 private: | 300 private: |
| 301 // These values are used for histograms. Do not reorder. |
| 302 enum AutoplayUnmuteActionStatus { |
| 303 AutoplayUnmuteActionFailure = 0, |
| 304 AutoplayUnmuteActionSuccess = 1, |
| 305 AutoplayUnmuteActionMax |
| 306 }; |
| 307 |
| 301 void resetMediaPlayerAndMediaSource(); | 308 void resetMediaPlayerAndMediaSource(); |
| 302 | 309 |
| 303 bool alwaysCreateUserAgentShadowRoot() const final { return true; } | 310 bool alwaysCreateUserAgentShadowRoot() const final { return true; } |
| 304 bool areAuthorShadowsAllowed() const final { return false; } | 311 bool areAuthorShadowsAllowed() const final { return false; } |
| 305 | 312 |
| 306 bool supportsFocus() const final; | 313 bool supportsFocus() const final; |
| 307 bool isMouseFocusable() const final; | 314 bool isMouseFocusable() const final; |
| 308 bool layoutObjectIsNeeded(const ComputedStyle&) override; | 315 bool layoutObjectIsNeeded(const ComputedStyle&) override; |
| 309 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 316 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
| 310 InsertionNotificationRequest insertedInto(ContainerNode*) final; | 317 InsertionNotificationRequest insertedInto(ContainerNode*) final; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 void scheduleRejectPlayPromises(ExceptionCode); | 493 void scheduleRejectPlayPromises(ExceptionCode); |
| 487 void scheduleNotifyPlaying(); | 494 void scheduleNotifyPlaying(); |
| 488 void resolveScheduledPlayPromises(); | 495 void resolveScheduledPlayPromises(); |
| 489 void rejectScheduledPlayPromises(); | 496 void rejectScheduledPlayPromises(); |
| 490 void rejectPlayPromises(ExceptionCode, const String&); | 497 void rejectPlayPromises(ExceptionCode, const String&); |
| 491 void rejectPlayPromisesInternal(ExceptionCode, const String&); | 498 void rejectPlayPromisesInternal(ExceptionCode, const String&); |
| 492 | 499 |
| 493 EnumerationHistogram& showControlsHistogram() const; | 500 EnumerationHistogram& showControlsHistogram() const; |
| 494 | 501 |
| 495 void recordAutoplaySourceMetric(int source); | 502 void recordAutoplaySourceMetric(int source); |
| 503 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus); |
| 496 | 504 |
| 497 void onVisibilityChangedForAutoplay(bool isVisible); | 505 void onVisibilityChangedForAutoplay(bool isVisible); |
| 498 | 506 |
| 499 UnthrottledTimer<HTMLMediaElement> m_loadTimer; | 507 UnthrottledTimer<HTMLMediaElement> m_loadTimer; |
| 500 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; | 508 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; |
| 501 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; | 509 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; |
| 502 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; | 510 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; |
| 503 Member<TimeRanges> m_playedTimeRanges; | 511 Member<TimeRanges> m_playedTimeRanges; |
| 504 Member<GenericEventQueue> m_asyncEventQueue; | 512 Member<GenericEventQueue> m_asyncEventQueue; |
| 505 | 513 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 inline bool isHTMLMediaElement(const HTMLElement& element) | 690 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 683 { | 691 { |
| 684 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 692 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 685 } | 693 } |
| 686 | 694 |
| 687 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 695 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 688 | 696 |
| 689 } // namespace blink | 697 } // namespace blink |
| 690 | 698 |
| 691 #endif // HTMLMediaElement_h | 699 #endif // HTMLMediaElement_h |
| OLD | NEW |