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

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

Issue 2477203002: Media Controls: delegate 'volumechange' and 'focusin' handling to an EventListener. (Closed)
Patch Set: moar tests Created 4 years, 1 month 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 UserMetricsAction("Media.Controls.Mute")); 292 UserMetricsAction("Media.Controls.Mute"));
293 293
294 mediaElement().setMuted(!mediaElement().muted()); 294 mediaElement().setMuted(!mediaElement().muted());
295 event->setDefaultHandled(); 295 event->setDefaultHandled();
296 } 296 }
297 297
298 MediaControlInputElement::defaultEventHandler(event); 298 MediaControlInputElement::defaultEventHandler(event);
299 } 299 }
300 300
301 void MediaControlMuteButtonElement::updateDisplayType() { 301 void MediaControlMuteButtonElement::updateDisplayType() {
302 setDisplayType(mediaElement().muted() ? MediaUnMuteButton : MediaMuteButton); 302 setDisplayType((mediaElement().muted() || mediaElement().volume() == 0)
foolip 2016/11/14 16:07:38 Why this change? Clicking it will only toggle mute
mlamouri (slow - plz ping) 2016/11/14 23:46:29 Because we actually show a "muted" button if the v
303 ? MediaUnMuteButton
304 : MediaMuteButton);
303 updateOverflowString(); 305 updateOverflowString();
304 } 306 }
305 307
306 WebLocalizedString::Name 308 WebLocalizedString::Name
307 MediaControlMuteButtonElement::getOverflowStringName() { 309 MediaControlMuteButtonElement::getOverflowStringName() {
308 if (mediaElement().muted()) 310 if (mediaElement().muted())
309 return WebLocalizedString::OverflowMenuUnmute; 311 return WebLocalizedString::OverflowMenuUnmute;
310 return WebLocalizedString::OverflowMenuMute; 312 return WebLocalizedString::OverflowMenuMute;
311 } 313 }
312 314
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 MediaControlCurrentTimeDisplayElement* 1037 MediaControlCurrentTimeDisplayElement*
1036 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { 1038 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) {
1037 MediaControlCurrentTimeDisplayElement* element = 1039 MediaControlCurrentTimeDisplayElement* element =
1038 new MediaControlCurrentTimeDisplayElement(mediaControls); 1040 new MediaControlCurrentTimeDisplayElement(mediaControls);
1039 element->setShadowPseudoId( 1041 element->setShadowPseudoId(
1040 AtomicString("-webkit-media-controls-current-time-display")); 1042 AtomicString("-webkit-media-controls-current-time-display"));
1041 return element; 1043 return element;
1042 } 1044 }
1043 1045
1044 } // namespace blink 1046 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698