| 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 16 matching lines...) Expand all Loading... |
| 27 #ifndef MediaControls_h | 27 #ifndef MediaControls_h |
| 28 #define MediaControls_h | 28 #define MediaControls_h |
| 29 | 29 |
| 30 #include "core/html/HTMLDivElement.h" | 30 #include "core/html/HTMLDivElement.h" |
| 31 #include "core/html/shadow/MediaControlElements.h" | 31 #include "core/html/shadow/MediaControlElements.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class Event; | 35 class Event; |
| 36 | 36 |
| 37 class MediaControls FINAL : public HTMLDivElement { | 37 class MediaControls final : public HTMLDivElement { |
| 38 public: | 38 public: |
| 39 static PassRefPtrWillBeRawPtr<MediaControls> create(HTMLMediaElement&); | 39 static PassRefPtrWillBeRawPtr<MediaControls> create(HTMLMediaElement&); |
| 40 | 40 |
| 41 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } | 41 HTMLMediaElement& mediaElement() const { return *m_mediaElement; } |
| 42 | 42 |
| 43 void reset(); | 43 void reset(); |
| 44 | 44 |
| 45 void show(); | 45 void show(); |
| 46 void hide(); | 46 void hide(); |
| 47 | 47 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 void startedCasting(); | 66 void startedCasting(); |
| 67 void stoppedCasting(); | 67 void stoppedCasting(); |
| 68 void refreshCastButtonVisibility(); | 68 void refreshCastButtonVisibility(); |
| 69 void showOverlayCastButton(); | 69 void showOverlayCastButton(); |
| 70 | 70 |
| 71 void updateTextTrackDisplay(); | 71 void updateTextTrackDisplay(); |
| 72 | 72 |
| 73 void mediaElementFocused(); | 73 void mediaElementFocused(); |
| 74 | 74 |
| 75 virtual void trace(Visitor*) OVERRIDE; | 75 virtual void trace(Visitor*) override; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 explicit MediaControls(HTMLMediaElement&); | 78 explicit MediaControls(HTMLMediaElement&); |
| 79 | 79 |
| 80 bool initializeControls(); | 80 bool initializeControls(); |
| 81 | 81 |
| 82 void makeOpaque(); | 82 void makeOpaque(); |
| 83 void makeTransparent(); | 83 void makeTransparent(); |
| 84 | 84 |
| 85 void updatePlayState(); | 85 void updatePlayState(); |
| 86 | 86 |
| 87 enum HideBehaviorFlags { | 87 enum HideBehaviorFlags { |
| 88 IgnoreVideoHover = 1 << 0, | 88 IgnoreVideoHover = 1 << 0, |
| 89 IgnoreFocus = 1 << 1, | 89 IgnoreFocus = 1 << 1, |
| 90 IgnoreControlsHover = 1 << 2 | 90 IgnoreControlsHover = 1 << 2 |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; | 93 bool shouldHideMediaControls(unsigned behaviorFlags = 0) const; |
| 94 void hideMediaControlsTimerFired(Timer<MediaControls>*); | 94 void hideMediaControlsTimerFired(Timer<MediaControls>*); |
| 95 void startHideMediaControlsTimer(); | 95 void startHideMediaControlsTimer(); |
| 96 void stopHideMediaControlsTimer(); | 96 void stopHideMediaControlsTimer(); |
| 97 void resetHideMediaControlsTimer(); | 97 void resetHideMediaControlsTimer(); |
| 98 | 98 |
| 99 void createTextTrackDisplay(); | 99 void createTextTrackDisplay(); |
| 100 void showTextTrackDisplay(); | 100 void showTextTrackDisplay(); |
| 101 void hideTextTrackDisplay(); | 101 void hideTextTrackDisplay(); |
| 102 | 102 |
| 103 // Node | 103 // Node |
| 104 virtual bool isMediaControls() const OVERRIDE { return true; } | 104 virtual bool isMediaControls() const override { return true; } |
| 105 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } | 105 virtual bool willRespondToMouseMoveEvents() override { return true; } |
| 106 virtual void defaultEventHandler(Event*) OVERRIDE; | 106 virtual void defaultEventHandler(Event*) override; |
| 107 bool containsRelatedTarget(Event*); | 107 bool containsRelatedTarget(Event*); |
| 108 | 108 |
| 109 // Element | 109 // Element |
| 110 virtual const AtomicString& shadowPseudoId() const OVERRIDE; | 110 virtual const AtomicString& shadowPseudoId() const override; |
| 111 | 111 |
| 112 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; | 112 RawPtrWillBeMember<HTMLMediaElement> m_mediaElement; |
| 113 | 113 |
| 114 // Container for the media control elements. | 114 // Container for the media control elements. |
| 115 RawPtrWillBeMember<MediaControlPanelElement> m_panel; | 115 RawPtrWillBeMember<MediaControlPanelElement> m_panel; |
| 116 | 116 |
| 117 // Container for the text track cues. | 117 // Container for the text track cues. |
| 118 RawPtrWillBeMember<MediaControlTextTrackContainerElement> m_textDisplayConta
iner; | 118 RawPtrWillBeMember<MediaControlTextTrackContainerElement> m_textDisplayConta
iner; |
| 119 | 119 |
| 120 // Media control elements. | 120 // Media control elements. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 136 bool m_isMouseOverControls : 1; | 136 bool m_isMouseOverControls : 1; |
| 137 bool m_isPausedForScrubbing : 1; | 137 bool m_isPausedForScrubbing : 1; |
| 138 bool m_wasLastEventTouch : 1; | 138 bool m_wasLastEventTouch : 1; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 141 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
| 142 | 142 |
| 143 } | 143 } |
| 144 | 144 |
| 145 #endif | 145 #endif |
| OLD | NEW |