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

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

Issue 130813006: Remove the user gesture restriction for HTMLMediaElement::pause() (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
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } 294 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
295 295
296 virtual bool isMediaElement() const OVERRIDE FINAL { return true; } 296 virtual bool isMediaElement() const OVERRIDE FINAL { return true; }
297 297
298 void setControllerInternal(PassRefPtr<MediaController>); 298 void setControllerInternal(PassRefPtr<MediaController>);
299 299
300 // Restrictions to change default behaviors. 300 // Restrictions to change default behaviors.
301 enum BehaviorRestrictionFlags { 301 enum BehaviorRestrictionFlags {
302 NoRestrictions = 0, 302 NoRestrictions = 0,
303 RequireUserGestureForLoadRestriction = 1 << 0, 303 RequireUserGestureForLoadRestriction = 1 << 0,
304 RequireUserGestureForRateChangeRestriction = 1 << 1, 304 RequireUserGestureForPlayRestriction = 1 << 1,
305 RequireUserGestureForFullscreenRestriction = 1 << 2, 305 RequireUserGestureForFullscreenRestriction = 1 << 2,
306 RequirePageConsentToLoadMediaRestriction = 1 << 3, 306 RequirePageConsentToLoadMediaRestriction = 1 << 3,
307 }; 307 };
308 typedef unsigned BehaviorRestrictions; 308 typedef unsigned BehaviorRestrictions;
309 309
310 bool userGestureRequiredForLoad() const { return m_restrictions & RequireUse rGestureForLoadRestriction; } 310 bool userGestureRequiredForLoad() const { return m_restrictions & RequireUse rGestureForLoadRestriction; }
311 bool userGestureRequiredForRateChange() const { return m_restrictions & Requ ireUserGestureForRateChangeRestriction; } 311 bool userGestureRequiredForPlay() const { return m_restrictions & RequireUse rGestureForPlayRestriction; }
312 bool userGestureRequiredForFullscreen() const { return m_restrictions & Requ ireUserGestureForFullscreenRestriction; } 312 bool userGestureRequiredForFullscreen() const { return m_restrictions & Requ ireUserGestureForFullscreenRestriction; }
313 bool pageConsentRequiredForLoad() const { return m_restrictions & RequirePag eConsentToLoadMediaRestriction; } 313 bool pageConsentRequiredForLoad() const { return m_restrictions & RequirePag eConsentToLoadMediaRestriction; }
314 314
315 void addBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictio ns |= restriction; } 315 void addBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictio ns |= restriction; }
316 void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restric tions &= ~restriction; } 316 void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restric tions &= ~restriction; }
317 317
318 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU pdate > 0; } 318 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU pdate > 0; }
319 void beginIgnoringTrackDisplayUpdateRequests(); 319 void beginIgnoringTrackDisplayUpdateRequests();
320 void endIgnoringTrackDisplayUpdateRequests(); 320 void endIgnoringTrackDisplayUpdateRequests();
321 321
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 void mediaLoadingFailed(MediaPlayer::NetworkState); 402 void mediaLoadingFailed(MediaPlayer::NetworkState);
403 403
404 void updateActiveTextTrackCues(double); 404 void updateActiveTextTrackCues(double);
405 HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const; 405 HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
406 406
407 void markCaptionAndSubtitleTracksAsUnconfigured(); 407 void markCaptionAndSubtitleTracksAsUnconfigured();
408 408
409 // These "internal" functions do not check user gesture restrictions. 409 // These "internal" functions do not check user gesture restrictions.
410 void loadInternal(); 410 void loadInternal();
411 void playInternal(); 411 void playInternal();
412 void pauseInternal();
413 412
414 void prepareForLoad(); 413 void prepareForLoad();
415 void allowVideoRendering(); 414 void allowVideoRendering();
416 415
417 void updateVolume(); 416 void updateVolume();
418 void updatePlayState(); 417 void updatePlayState();
419 bool potentiallyPlaying() const; 418 bool potentiallyPlaying() const;
420 bool endedPlayback() const; 419 bool endedPlayback() const;
421 bool stoppedDueToErrors() const; 420 bool stoppedDueToErrors() const;
422 bool pausedForUserInteraction() const; 421 bool pausedForUserInteraction() const;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 inline bool isHTMLMediaElement(const Node& node) 598 inline bool isHTMLMediaElement(const Node& node)
600 { 599 {
601 return node.isElementNode() && toElement(node).isMediaElement(); 600 return node.isElementNode() && toElement(node).isMediaElement();
602 } 601 }
603 602
604 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 603 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
605 604
606 } //namespace 605 } //namespace
607 606
608 #endif 607 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLMediaElement.cpp » ('j') | Source/core/html/HTMLMediaElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698