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 19 matching lines...) Expand all Loading... |
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 WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class Document; | 35 class Document; |
36 class Event; | 36 class Event; |
37 | 37 |
38 class MediaControls FINAL : public HTMLDivElement { | 38 class MediaControls FINAL : public HTMLDivElement { |
39 public: | 39 public: |
40 static PassRefPtr<MediaControls> create(Document&); | 40 static PassRefPtr<MediaControls> create(HTMLMediaElement&); |
41 | 41 |
42 void setMediaController(MediaControllerInterface*); | 42 HTMLMediaElement& mediaElement() const { return m_mediaElement; } |
| 43 MediaControllerInterface& mediaControllerInterface() const; |
43 | 44 |
44 void reset(); | 45 void reset(); |
45 | 46 |
46 void show(); | 47 void show(); |
47 void hide(); | 48 void hide(); |
48 | 49 |
49 void playbackStarted(); | 50 void playbackStarted(); |
50 void playbackProgressed(); | 51 void playbackProgressed(); |
51 void playbackStopped(); | 52 void playbackStopped(); |
52 | 53 |
53 void updateCurrentTimeDisplay(); | 54 void updateCurrentTimeDisplay(); |
54 | 55 |
55 void changedMute(); | 56 void changedMute(); |
56 void changedVolume(); | 57 void changedVolume(); |
57 | 58 |
58 void changedClosedCaptionsVisibility(); | 59 void changedClosedCaptionsVisibility(); |
59 void refreshClosedCaptionsButtonVisibility(); | 60 void refreshClosedCaptionsButtonVisibility(); |
60 void closedCaptionTracksChanged(); | 61 void closedCaptionTracksChanged(); |
61 | 62 |
62 void enteredFullscreen(); | 63 void enteredFullscreen(); |
63 void exitedFullscreen(); | 64 void exitedFullscreen(); |
64 | 65 |
65 void updateTextTrackDisplay(); | 66 void updateTextTrackDisplay(); |
66 | 67 |
67 private: | 68 private: |
68 explicit MediaControls(Document&); | 69 explicit MediaControls(HTMLMediaElement&); |
69 | 70 |
70 bool initializeControls(Document&); | 71 bool initializeControls(); |
71 | 72 |
72 void makeOpaque(); | 73 void makeOpaque(); |
73 void makeTransparent(); | 74 void makeTransparent(); |
74 | 75 |
75 bool shouldHideFullscreenControls(); | 76 bool shouldHideFullscreenControls(); |
76 void hideFullscreenControlsTimerFired(Timer<MediaControls>*); | 77 void hideFullscreenControlsTimerFired(Timer<MediaControls>*); |
77 void startHideFullscreenControlsTimer(); | 78 void startHideFullscreenControlsTimer(); |
78 void stopHideFullscreenControlsTimer(); | 79 void stopHideFullscreenControlsTimer(); |
79 | 80 |
80 void createTextTrackDisplay(); | 81 void createTextTrackDisplay(); |
81 void showTextTrackDisplay(); | 82 void showTextTrackDisplay(); |
82 void hideTextTrackDisplay(); | 83 void hideTextTrackDisplay(); |
83 | 84 |
84 // Node | 85 // Node |
85 virtual bool isMediaControls() const OVERRIDE { return true; } | 86 virtual bool isMediaControls() const OVERRIDE { return true; } |
86 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } | 87 virtual bool willRespondToMouseMoveEvents() OVERRIDE { return true; } |
87 virtual void defaultEventHandler(Event*) OVERRIDE; | 88 virtual void defaultEventHandler(Event*) OVERRIDE; |
88 bool containsRelatedTarget(Event*); | 89 bool containsRelatedTarget(Event*); |
89 | 90 |
90 // Element | 91 // Element |
91 virtual const AtomicString& shadowPseudoId() const OVERRIDE; | 92 virtual const AtomicString& shadowPseudoId() const OVERRIDE; |
92 | 93 |
93 MediaControllerInterface* m_mediaController; | 94 HTMLMediaElement& m_mediaElement; |
94 | 95 |
95 // Container for the media control elements. | 96 // Container for the media control elements. |
96 MediaControlPanelElement* m_panel; | 97 MediaControlPanelElement* m_panel; |
97 | 98 |
98 // Container for the text track cues. | 99 // Container for the text track cues. |
99 MediaControlTextTrackContainerElement* m_textDisplayContainer; | 100 MediaControlTextTrackContainerElement* m_textDisplayContainer; |
100 | 101 |
101 // Media control elements. | 102 // Media control elements. |
102 MediaControlOverlayPlayButtonElement* m_overlayPlayButton; | 103 MediaControlOverlayPlayButtonElement* m_overlayPlayButton; |
103 MediaControlOverlayEnclosureElement* m_overlayEnclosure; | 104 MediaControlOverlayEnclosureElement* m_overlayEnclosure; |
(...skipping 10 matching lines...) Expand all Loading... |
114 Timer<MediaControls> m_hideFullscreenControlsTimer; | 115 Timer<MediaControls> m_hideFullscreenControlsTimer; |
115 bool m_isFullscreen; | 116 bool m_isFullscreen; |
116 bool m_isMouseOverControls; | 117 bool m_isMouseOverControls; |
117 }; | 118 }; |
118 | 119 |
119 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); | 120 DEFINE_ELEMENT_TYPE_CASTS(MediaControls, isMediaControls()); |
120 | 121 |
121 } | 122 } |
122 | 123 |
123 #endif | 124 #endif |
OLD | NEW |