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

Side by Side Diff: Source/core/rendering/RenderMediaControls.cpp

Issue 239113003: Use the media controls play button internal state for painting (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 | « LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html ('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) 2009 Apple Inc. 2 * Copyright (C) 2009 Apple Inc.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (!mediaElement) 99 if (!mediaElement)
100 return false; 100 return false;
101 101
102 static Image* mediaPlay = platformResource("mediaplayerPlay"); 102 static Image* mediaPlay = platformResource("mediaplayerPlay");
103 static Image* mediaPause = platformResource("mediaplayerPause"); 103 static Image* mediaPause = platformResource("mediaplayerPause");
104 static Image* mediaPlayDisabled = platformResource("mediaplayerPlayDisabled" ); 104 static Image* mediaPlayDisabled = platformResource("mediaplayerPlayDisabled" );
105 105
106 if (!hasSource(mediaElement)) 106 if (!hasSource(mediaElement))
107 return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled); 107 return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled);
108 108
109 return paintMediaButton(paintInfo.context, rect, mediaElement->togglePlaySta teWillPlay() ? mediaPlay : mediaPause); 109 return paintMediaButton(paintInfo.context, rect, mediaControlElementType(obj ect->node()) == MediaPlayButton ? mediaPlay : mediaPause);
110 } 110 }
111 111
112 static bool paintMediaOverlayPlayButton(RenderObject* object, const PaintInfo& p aintInfo, const IntRect& rect) 112 static bool paintMediaOverlayPlayButton(RenderObject* object, const PaintInfo& p aintInfo, const IntRect& rect)
113 { 113 {
114 HTMLMediaElement* mediaElement = toParentMediaElement(object); 114 HTMLMediaElement* mediaElement = toParentMediaElement(object);
115 if (!mediaElement) 115 if (!mediaElement)
116 return false; 116 return false;
117 117
118 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay()) 118 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay())
119 return false; 119 return false;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 { 434 {
435 return formatChromiumMediaControlsTime(time, time); 435 return formatChromiumMediaControlsTime(time, time);
436 } 436 }
437 437
438 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) 438 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration)
439 { 439 {
440 return formatChromiumMediaControlsTime(currentTime, duration); 440 return formatChromiumMediaControlsTime(currentTime, duration);
441 } 441 }
442 442
443 } // namespace WebCore 443 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/media/controls-drag-timebar-rendering-expected-mismatch.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698