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

Side by Side Diff: Source/core/html/shadow/MediaControlElements.cpp

Issue 363563007: Only show overlay play button when controls are enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@shouldShowControls
Patch Set: Extended test coverage Created 6 years, 5 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) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 { 276 {
277 if (event->type() == EventTypeNames::click && mediaElement().togglePlayState WillPlay()) { 277 if (event->type() == EventTypeNames::click && mediaElement().togglePlayState WillPlay()) {
278 mediaElement().togglePlayState(); 278 mediaElement().togglePlayState();
279 updateDisplayType(); 279 updateDisplayType();
280 event->setDefaultHandled(); 280 event->setDefaultHandled();
281 } 281 }
282 } 282 }
283 283
284 void MediaControlOverlayPlayButtonElement::updateDisplayType() 284 void MediaControlOverlayPlayButtonElement::updateDisplayType()
285 { 285 {
286 if (mediaElement().togglePlayStateWillPlay()) { 286 if (mediaElement().shouldShowControls() && mediaElement().togglePlayStateWil lPlay()) {
287 show(); 287 show();
288 } else 288 } else
289 hide(); 289 hide();
290 } 290 }
291 291
292 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const 292 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const
293 { 293 {
294 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-overlay-play- button", AtomicString::ConstructFromLiteral)); 294 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-overlay-play- button", AtomicString::ConstructFromLiteral));
295 return id; 295 return id;
296 } 296 }
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 float fontSize = smallestDimension * 0.05f; 675 float fontSize = smallestDimension * 0.05f;
676 if (fontSize != m_fontSize) { 676 if (fontSize != m_fontSize) {
677 m_fontSize = fontSize; 677 m_fontSize = fontSize;
678 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX); 678 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX);
679 } 679 }
680 } 680 }
681 681
682 // ---------------------------- 682 // ----------------------------
683 683
684 } // namespace WebCore 684 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/media/video-controls-overlay-play-button-expected.txt ('k') | Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698