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

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

Issue 2692903002: Don't show media controls when there is a persistent video. (Closed)
Patch Set: cleanup and tests 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (!mediaElement().shouldShowControls() && !mediaElement().autoplay() && 525 if (!mediaElement().shouldShowControls() && !mediaElement().autoplay() &&
526 mediaElement().paused()) { 526 mediaElement().paused()) {
527 // Note that this is a case where we add the overlay cast button 527 // Note that this is a case where we add the overlay cast button
528 // without wanting the panel cast button. We depend on the fact 528 // without wanting the panel cast button. We depend on the fact
529 // that computeWhichControlsFit() won't change overlay cast button 529 // that computeWhichControlsFit() won't change overlay cast button
530 // visibility in the case where the cast button isn't wanted. 530 // visibility in the case where the cast button isn't wanted.
531 // We don't call compute...() here, but it will be called as 531 // We don't call compute...() here, but it will be called as
532 // non-cast changes (e.g., resize) occur. If the panel button 532 // non-cast changes (e.g., resize) occur. If the panel button
533 // is shown, however, compute...() will take control of the 533 // is shown, however, compute...() will take control of the
534 // overlay cast button if it needs to hide it from the panel. 534 // overlay cast button if it needs to hide it from the panel.
535 m_overlayCastButton->tryShowOverlay(); 535 if (!document().settings() ||
536 !document().settings()->getMediaControlsEnabled()) {
537 m_overlayCastButton->tryShowOverlay();
538 }
536 m_castButton->setIsWanted(false); 539 m_castButton->setIsWanted(false);
537 } else if (mediaElement().shouldShowControls()) { 540 } else if (mediaElement().shouldShowControls()) {
538 m_overlayCastButton->setIsWanted(false); 541 m_overlayCastButton->setIsWanted(false);
539 m_castButton->setIsWanted(true); 542 m_castButton->setIsWanted(true);
540 } 543 }
541 } 544 }
542 545
543 void MediaControls::showOverlayCastButtonIfNeeded() { 546 void MediaControls::showOverlayCastButtonIfNeeded() {
544 if (mediaElement().shouldShowControls() || 547 if (mediaElement().shouldShowControls() ||
545 !shouldShowCastButton(mediaElement())) 548 !shouldShowCastButton(mediaElement()))
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 visitor->trace(m_overflowList); 975 visitor->trace(m_overflowList);
973 visitor->trace(m_castButton); 976 visitor->trace(m_castButton);
974 visitor->trace(m_overlayCastButton); 977 visitor->trace(m_overlayCastButton);
975 visitor->trace(m_mediaEventListener); 978 visitor->trace(m_mediaEventListener);
976 visitor->trace(m_windowEventListener); 979 visitor->trace(m_windowEventListener);
977 visitor->trace(m_orientationLockDelegate); 980 visitor->trace(m_orientationLockDelegate);
978 HTMLDivElement::trace(visitor); 981 HTMLDivElement::trace(visitor);
979 } 982 }
980 983
981 } // namespace blink 984 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698