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

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

Issue 215323003: Let the overlay playback button fall back to the activation behavior (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 PassRefPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonEl ement::create(MediaControls& mediaControls) 266 PassRefPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonEl ement::create(MediaControls& mediaControls)
267 { 267 {
268 RefPtr<MediaControlOverlayPlayButtonElement> button = adoptRef(new MediaCont rolOverlayPlayButtonElement(mediaControls)); 268 RefPtr<MediaControlOverlayPlayButtonElement> button = adoptRef(new MediaCont rolOverlayPlayButtonElement(mediaControls));
269 button->ensureUserAgentShadowRoot(); 269 button->ensureUserAgentShadowRoot();
270 button->setType("button"); 270 button->setType("button");
271 return button.release(); 271 return button.release();
272 } 272 }
273 273
274 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event)
275 {
276 if (event->type() == EventTypeNames::click && mediaElement().togglePlayState WillPlay()) {
277 mediaElement().togglePlayState();
278 updateDisplayType();
279 event->setDefaultHandled();
280 }
281 HTMLInputElement::defaultEventHandler(event);
282 }
283
284 void MediaControlOverlayPlayButtonElement::updateDisplayType() 274 void MediaControlOverlayPlayButtonElement::updateDisplayType()
285 { 275 {
286 if (mediaElement().togglePlayStateWillPlay()) { 276 if (mediaElement().togglePlayStateWillPlay()) {
287 show(); 277 show();
288 } else 278 } else
289 hide(); 279 hide();
290 } 280 }
291 281
292 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const 282 const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const
293 { 283 {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 float fontSize = smallestDimension * 0.05f; 664 float fontSize = smallestDimension * 0.05f;
675 if (fontSize != m_fontSize) { 665 if (fontSize != m_fontSize) {
676 m_fontSize = fontSize; 666 m_fontSize = fontSize;
677 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX); 667 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX);
678 } 668 }
679 } 669 }
680 670
681 // ---------------------------- 671 // ----------------------------
682 672
683 } // namespace WebCore 673 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698