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

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

Issue 199413008: Simplify MediaControls::show() and hide() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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.cpp ('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) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/html/shadow/MediaControls.h" 28 #include "core/html/shadow/MediaControls.h"
29 29
30 #include "HTMLNames.h"
30 #include "bindings/v8/ExceptionStatePlaceholder.h" 31 #include "bindings/v8/ExceptionStatePlaceholder.h"
31 #include "core/events/MouseEvent.h" 32 #include "core/events/MouseEvent.h"
32 #include "core/html/HTMLMediaElement.h" 33 #include "core/html/HTMLMediaElement.h"
33 #include "core/html/MediaController.h" 34 #include "core/html/MediaController.h"
34 #include "core/rendering/RenderTheme.h" 35 #include "core/rendering/RenderTheme.h"
35 36
36 namespace WebCore { 37 namespace WebCore {
37 38
38 #if OS(ANDROID) 39 #if OS(ANDROID)
39 static const bool alwaysHideFullscreenControls = true; 40 static const bool alwaysHideFullscreenControls = true;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (mediaControllerInterface().hasVideo()) 195 if (mediaControllerInterface().hasVideo())
195 m_fullScreenButton->show(); 196 m_fullScreenButton->show();
196 else 197 else
197 m_fullScreenButton->hide(); 198 m_fullScreenButton->hide();
198 199
199 makeOpaque(); 200 makeOpaque();
200 } 201 }
201 202
202 void MediaControls::show() 203 void MediaControls::show()
203 { 204 {
205 setBooleanAttribute(HTMLNames::hiddenAttr, false);
204 makeOpaque(); 206 makeOpaque();
205 m_panel->setIsDisplayed(true);
206 m_panel->show();
207 } 207 }
208 208
209 void MediaControls::hide() 209 void MediaControls::hide()
210 { 210 {
211 m_panel->setIsDisplayed(false); 211 setBooleanAttribute(HTMLNames::hiddenAttr, true);
212 m_panel->hide();
213 } 212 }
214 213
215 void MediaControls::makeOpaque() 214 void MediaControls::makeOpaque()
216 { 215 {
217 m_panel->makeOpaque(); 216 m_panel->makeOpaque();
218 } 217 }
219 218
220 void MediaControls::makeTransparent() 219 void MediaControls::makeTransparent()
221 { 220 {
222 m_panel->makeTransparent(); 221 m_panel->makeTransparent();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 437
439 void MediaControls::updateTextTrackDisplay() 438 void MediaControls::updateTextTrackDisplay()
440 { 439 {
441 if (!m_textDisplayContainer) 440 if (!m_textDisplayContainer)
442 createTextTrackDisplay(); 441 createTextTrackDisplay();
443 442
444 m_textDisplayContainer->updateDisplay(); 443 m_textDisplayContainer->updateDisplay();
445 } 444 }
446 445
447 } 446 }
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698