| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 return true; | 70 return true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { | 73 static bool shouldShowCastButton(HTMLMediaElement& mediaElement) { |
| 74 return !mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr) && | 74 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) |
| 75 mediaElement.hasRemoteRoutes(); | 75 return false; |
| 76 |
| 77 // Explicitly do not show cast button when the mediaControlsEnabled setting is |
| 78 // false to make sure the overlay does not appear. |
| 79 Document& document = mediaElement.document(); |
| 80 if (document.settings() && !document.settings()->getMediaControlsEnabled()) |
| 81 return false; |
| 82 |
| 83 return mediaElement.hasRemoteRoutes(); |
| 76 } | 84 } |
| 77 | 85 |
| 78 static bool preferHiddenVolumeControls(const Document& document) { | 86 static bool preferHiddenVolumeControls(const Document& document) { |
| 79 return !document.settings() || | 87 return !document.settings() || |
| 80 document.settings()->getPreferHiddenVolumeControls(); | 88 document.settings()->getPreferHiddenVolumeControls(); |
| 81 } | 89 } |
| 82 | 90 |
| 83 class MediaControls::BatchedControlUpdate { | 91 class MediaControls::BatchedControlUpdate { |
| 84 WTF_MAKE_NONCOPYABLE(BatchedControlUpdate); | 92 WTF_MAKE_NONCOPYABLE(BatchedControlUpdate); |
| 85 STACK_ALLOCATED(); | 93 STACK_ALLOCATED(); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 visitor->trace(m_overflowList); | 979 visitor->trace(m_overflowList); |
| 972 visitor->trace(m_castButton); | 980 visitor->trace(m_castButton); |
| 973 visitor->trace(m_overlayCastButton); | 981 visitor->trace(m_overlayCastButton); |
| 974 visitor->trace(m_mediaEventListener); | 982 visitor->trace(m_mediaEventListener); |
| 975 visitor->trace(m_windowEventListener); | 983 visitor->trace(m_windowEventListener); |
| 976 visitor->trace(m_orientationLockDelegate); | 984 visitor->trace(m_orientationLockDelegate); |
| 977 HTMLDivElement::trace(visitor); | 985 HTMLDivElement::trace(visitor); |
| 978 } | 986 } |
| 979 | 987 |
| 980 } // namespace blink | 988 } // namespace blink |
| OLD | NEW |