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

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

Issue 2657723002: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: Created 3 years, 10 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 return !mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr) && 77 if (mediaElement.fastHasAttribute(HTMLNames::disableremoteplaybackAttr))
75 mediaElement.hasRemoteRoutes(); 78 return false;
79
80 if (mediaElement.controlsList()->tokens().contains("noremoteplayback"))
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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 visitor->trace(m_overflowList); 980 visitor->trace(m_overflowList);
973 visitor->trace(m_castButton); 981 visitor->trace(m_castButton);
974 visitor->trace(m_overlayCastButton); 982 visitor->trace(m_overlayCastButton);
975 visitor->trace(m_mediaEventListener); 983 visitor->trace(m_mediaEventListener);
976 visitor->trace(m_windowEventListener); 984 visitor->trace(m_windowEventListener);
977 visitor->trace(m_orientationLockDelegate); 985 visitor->trace(m_orientationLockDelegate);
978 HTMLDivElement::trace(visitor); 986 HTMLDivElement::trace(visitor);
979 } 987 }
980 988
981 } // namespace blink 989 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698