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 20 matching lines...) Expand all Loading... |
31 #include "core/dom/Fullscreen.h" | 31 #include "core/dom/Fullscreen.h" |
32 #include "core/dom/ResizeObserver.h" | 32 #include "core/dom/ResizeObserver.h" |
33 #include "core/dom/ResizeObserverCallback.h" | 33 #include "core/dom/ResizeObserverCallback.h" |
34 #include "core/dom/ResizeObserverEntry.h" | 34 #include "core/dom/ResizeObserverEntry.h" |
35 #include "core/dom/TaskRunnerHelper.h" | 35 #include "core/dom/TaskRunnerHelper.h" |
36 #include "core/events/MouseEvent.h" | 36 #include "core/events/MouseEvent.h" |
37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
38 #include "core/frame/UseCounter.h" | 38 #include "core/frame/UseCounter.h" |
39 #include "core/html/HTMLMediaElement.h" | 39 #include "core/html/HTMLMediaElement.h" |
40 #include "core/html/HTMLVideoElement.h" | 40 #include "core/html/HTMLVideoElement.h" |
| 41 #include "core/html/media/HTMLMediaElementControlsList.h" |
41 #include "core/html/shadow/MediaControlsMediaEventListener.h" | 42 #include "core/html/shadow/MediaControlsMediaEventListener.h" |
42 #include "core/html/shadow/MediaControlsOrientationLockDelegate.h" | 43 #include "core/html/shadow/MediaControlsOrientationLockDelegate.h" |
43 #include "core/html/shadow/MediaControlsWindowEventListener.h" | 44 #include "core/html/shadow/MediaControlsWindowEventListener.h" |
44 #include "core/html/track/TextTrackContainer.h" | 45 #include "core/html/track/TextTrackContainer.h" |
45 #include "core/html/track/TextTrackList.h" | 46 #include "core/html/track/TextTrackList.h" |
46 #include "core/layout/LayoutObject.h" | 47 #include "core/layout/LayoutObject.h" |
47 #include "core/layout/LayoutTheme.h" | 48 #include "core/layout/LayoutTheme.h" |
48 #include "platform/EventDispatchForbiddenScope.h" | 49 #include "platform/EventDispatchForbiddenScope.h" |
49 | 50 |
50 namespace blink { | 51 namespace blink { |
(...skipping 30 matching lines...) Expand all Loading... |
81 | 82 |
82 if (!mediaElement.isHTMLVideoElement()) | 83 if (!mediaElement.isHTMLVideoElement()) |
83 return false; | 84 return false; |
84 | 85 |
85 if (!mediaElement.hasVideo()) | 86 if (!mediaElement.hasVideo()) |
86 return false; | 87 return false; |
87 | 88 |
88 if (!Fullscreen::fullscreenEnabled(mediaElement.document())) | 89 if (!Fullscreen::fullscreenEnabled(mediaElement.document())) |
89 return false; | 90 return false; |
90 | 91 |
91 if (mediaElement.controlsList()->shouldHideFullscreen()) { | 92 if (mediaElement.controlsListInternal()->shouldHideFullscreen()) { |
92 UseCounter::count(mediaElement.document(), | 93 UseCounter::count(mediaElement.document(), |
93 UseCounter::HTMLMediaElementControlsListNoFullscreen); | 94 UseCounter::HTMLMediaElementControlsListNoFullscreen); |
94 return false; | 95 return false; |
95 } | 96 } |
96 | 97 |
97 return true; | 98 return true; |
98 } | 99 } |
99 | 100 |
100 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { | 101 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { |
101 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) | 102 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) |
102 return false; | 103 return false; |
103 | 104 |
104 // Explicitly do not show cast button when the mediaControlsEnabled setting is | 105 // Explicitly do not show cast button when the mediaControlsEnabled setting is |
105 // false to make sure the overlay does not appear. | 106 // false to make sure the overlay does not appear. |
106 Document& document = mediaElement.document(); | 107 Document& document = mediaElement.document(); |
107 if (document.settings() && !document.settings()->getMediaControlsEnabled()) | 108 if (document.settings() && !document.settings()->getMediaControlsEnabled()) |
108 return false; | 109 return false; |
109 | 110 |
110 // The page disabled the button via the attribute. | 111 // The page disabled the button via the attribute. |
111 if (mediaElement.controlsList()->shouldHideRemotePlayback()) { | 112 if (mediaElement.controlsListInternal()->shouldHideRemotePlayback()) { |
112 UseCounter::count(mediaElement.document(), | 113 UseCounter::count(mediaElement.document(), |
113 UseCounter::HTMLMediaElementControlsListNoRemotePlayback); | 114 UseCounter::HTMLMediaElementControlsListNoRemotePlayback); |
114 return false; | 115 return false; |
115 } | 116 } |
116 | 117 |
117 return mediaElement.hasRemoteRoutes(); | 118 return mediaElement.hasRemoteRoutes(); |
118 } | 119 } |
119 | 120 |
120 static bool preferHiddenVolumeControls(const Document& document) { | 121 static bool preferHiddenVolumeControls(const Document& document) { |
121 return !document.settings() || | 122 return !document.settings() || |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 visitor->trace(m_overflowList); | 1101 visitor->trace(m_overflowList); |
1101 visitor->trace(m_castButton); | 1102 visitor->trace(m_castButton); |
1102 visitor->trace(m_overlayCastButton); | 1103 visitor->trace(m_overlayCastButton); |
1103 visitor->trace(m_mediaEventListener); | 1104 visitor->trace(m_mediaEventListener); |
1104 visitor->trace(m_windowEventListener); | 1105 visitor->trace(m_windowEventListener); |
1105 visitor->trace(m_orientationLockDelegate); | 1106 visitor->trace(m_orientationLockDelegate); |
1106 HTMLDivElement::trace(visitor); | 1107 HTMLDivElement::trace(visitor); |
1107 } | 1108 } |
1108 | 1109 |
1109 } // namespace blink | 1110 } // namespace blink |
OLD | NEW |