Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2657723002: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: Rebased and readded the tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 visitor->trace(m_overflowList); 1004 visitor->trace(m_overflowList);
998 visitor->trace(m_castButton); 1005 visitor->trace(m_castButton);
999 visitor->trace(m_overlayCastButton); 1006 visitor->trace(m_overlayCastButton);
1000 visitor->trace(m_mediaEventListener); 1007 visitor->trace(m_mediaEventListener);
1001 visitor->trace(m_windowEventListener); 1008 visitor->trace(m_windowEventListener);
1002 visitor->trace(m_orientationLockDelegate); 1009 visitor->trace(m_orientationLockDelegate);
1003 HTMLDivElement::trace(visitor); 1010 HTMLDivElement::trace(visitor);
1004 } 1011 }
1005 1012
1006 } // namespace blink 1013 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698