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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 139233008: Remove HTMLMediaElement::togglePlayState() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 m_muted = muted; 2388 m_muted = muted;
2389 if (m_player) { 2389 if (m_player) {
2390 m_player->setMuted(m_muted); 2390 m_player->setMuted(m_muted);
2391 if (hasMediaControls()) 2391 if (hasMediaControls())
2392 mediaControls()->changedMute(); 2392 mediaControls()->changedMute();
2393 } 2393 }
2394 scheduleEvent(EventTypeNames::volumechange); 2394 scheduleEvent(EventTypeNames::volumechange);
2395 } 2395 }
2396 } 2396 }
2397 2397
2398 void HTMLMediaElement::togglePlayState()
2399 {
2400 WTF_LOG(Media, "HTMLMediaElement::togglePlayState - canPlay() is %s", boolSt ring(canPlay()));
2401
2402 // We can safely call the internal play/pause methods, which don't check res trictions, because
2403 // this method is only called from the built-in media controller
2404 if (canPlay()) {
2405 updatePlaybackRate();
2406 playInternal();
2407 } else
2408 pauseInternal();
2409 }
2410
2411 void HTMLMediaElement::beginScrubbing() 2398 void HTMLMediaElement::beginScrubbing()
2412 { 2399 {
2413 WTF_LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolStri ng(paused())); 2400 WTF_LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolStri ng(paused()));
2414 2401
2415 if (!paused()) { 2402 if (!paused()) {
2416 if (ended()) { 2403 if (ended()) {
2417 // Because a media element stays in non-paused state when it reaches end, playback resumes 2404 // Because a media element stays in non-paused state when it reaches end, playback resumes
2418 // when the slider is dragged from the end to another position unles s we pause first. Do 2405 // when the slider is dragged from the end to another position unles s we pause first. Do
2419 // a "hard pause" so an event is generated, since we want to stay pa used after scrubbing finishes. 2406 // a "hard pause" so an event is generated, since we want to stay pa used after scrubbing finishes.
2420 pause(); 2407 pause();
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
3962 { 3949 {
3963 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3950 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3964 } 3951 }
3965 3952
3966 bool HTMLMediaElement::isInteractiveContent() const 3953 bool HTMLMediaElement::isInteractiveContent() const
3967 { 3954 {
3968 return fastHasAttribute(controlsAttr); 3955 return fastHasAttribute(controlsAttr);
3969 } 3956 }
3970 3957
3971 } 3958 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698