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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 if (!mediaElement.isHTMLVideoElement()) | 61 if (!mediaElement.isHTMLVideoElement()) |
62 return false; | 62 return false; |
63 | 63 |
64 if (!mediaElement.hasVideo()) | 64 if (!mediaElement.hasVideo()) |
65 return false; | 65 return false; |
66 | 66 |
67 if (!Fullscreen::fullscreenEnabled(mediaElement.document())) | 67 if (!Fullscreen::fullscreenEnabled(mediaElement.document())) |
68 return false; | 68 return false; |
69 | 69 |
| 70 if (mediaElement.controlsList()->tokens().contains("nofullscreen")) |
| 71 return false; |
| 72 |
70 return true; | 73 return true; |
71 } | 74 } |
72 | 75 |
73 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { | 76 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { |
74 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) | 77 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) |
75 return false; | 78 return false; |
76 | 79 |
77 // Explicitly do not show cast button when the mediaControlsEnabled setting is | 80 // Explicitly do not show cast button when the mediaControlsEnabled setting is |
78 // false to make sure the overlay does not appear. | 81 // false to make sure the overlay does not appear. |
79 Document& document = mediaElement.document(); | 82 Document& document = mediaElement.document(); |
80 if (document.settings() && !document.settings()->getMediaControlsEnabled()) | 83 if (document.settings() && !document.settings()->getMediaControlsEnabled()) |
81 return false; | 84 return false; |
82 | 85 |
| 86 // The page disabled the button via the attribute. |
| 87 if (mediaElement.controlsList()->tokens().contains("noremoteplayback")) |
| 88 return false; |
| 89 |
83 return mediaElement.hasRemoteRoutes(); | 90 return mediaElement.hasRemoteRoutes(); |
84 } | 91 } |
85 | 92 |
86 static bool preferHiddenVolumeControls(const Document& document) { | 93 static bool preferHiddenVolumeControls(const Document& document) { |
87 return !document.settings() || | 94 return !document.settings() || |
88 document.settings()->getPreferHiddenVolumeControls(); | 95 document.settings()->getPreferHiddenVolumeControls(); |
89 } | 96 } |
90 | 97 |
91 class MediaControls::BatchedControlUpdate { | 98 class MediaControls::BatchedControlUpdate { |
92 WTF_MAKE_NONCOPYABLE(BatchedControlUpdate); | 99 WTF_MAKE_NONCOPYABLE(BatchedControlUpdate); |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 visitor->trace(m_overflowList); | 983 visitor->trace(m_overflowList); |
977 visitor->trace(m_castButton); | 984 visitor->trace(m_castButton); |
978 visitor->trace(m_overlayCastButton); | 985 visitor->trace(m_overlayCastButton); |
979 visitor->trace(m_mediaEventListener); | 986 visitor->trace(m_mediaEventListener); |
980 visitor->trace(m_windowEventListener); | 987 visitor->trace(m_windowEventListener); |
981 visitor->trace(m_orientationLockDelegate); | 988 visitor->trace(m_orientationLockDelegate); |
982 HTMLDivElement::trace(visitor); | 989 HTMLDivElement::trace(visitor); |
983 } | 990 } |
984 | 991 |
985 } // namespace blink | 992 } // namespace blink |
OLD | NEW |