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

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

Issue 182613006: Remove media controls when not in use. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Track visibility in controls. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 void MediaControlsAndroid::setMediaController(MediaControllerInterface* controll er) 60 void MediaControlsAndroid::setMediaController(MediaControllerInterface* controll er)
61 { 61 {
62 if (m_overlayPlayButton) 62 if (m_overlayPlayButton)
63 m_overlayPlayButton->setMediaController(controller); 63 m_overlayPlayButton->setMediaController(controller);
64 if (m_overlayEnclosure) 64 if (m_overlayEnclosure)
65 m_overlayEnclosure->setMediaController(controller); 65 m_overlayEnclosure->setMediaController(controller);
66 MediaControls::setMediaController(controller); 66 MediaControls::setMediaController(controller);
67 } 67 }
68 68
69 void MediaControlsAndroid::show()
70 {
71 m_overlayPlayButton->setVisible(true);
72 m_overlayPlayButton->updateDisplayType();
73 MediaControls::show();
74 }
75
76 void MediaControlsAndroid::hide()
77 {
78 m_overlayPlayButton->setVisible(false);
79 m_overlayPlayButton->updateDisplayType();
acolwell GONE FROM CHROMIUM 2014/03/06 19:21:54 nit: It seems like you could unconditionally hide
philipj_slow 2014/03/18 04:14:13 Yes, when moving this into MediaControls.cpp try j
80 MediaControls::hide();
81 }
82
69 void MediaControlsAndroid::playbackStarted() 83 void MediaControlsAndroid::playbackStarted()
70 { 84 {
71 m_overlayPlayButton->updateDisplayType(); 85 m_overlayPlayButton->updateDisplayType();
acolwell GONE FROM CHROMIUM 2014/03/06 19:21:54 It seems like you could make this call and the one
Fredrik Öhrn 2014/03/07 09:45:45 Problem is that MediaControlOverlayPlayButtonEleme
72 MediaControls::playbackStarted(); 86 MediaControls::playbackStarted();
73 } 87 }
74 88
75 void MediaControlsAndroid::playbackStopped() 89 void MediaControlsAndroid::playbackStopped()
76 { 90 {
77 m_overlayPlayButton->updateDisplayType(); 91 m_overlayPlayButton->updateDisplayType();
78 MediaControls::playbackStopped(); 92 MediaControls::playbackStopped();
79 } 93 }
80 94
81 void MediaControlsAndroid::insertTextTrackContainer(PassRefPtr<MediaControlTextT rackContainerElement> textTrackContainer) 95 void MediaControlsAndroid::insertTextTrackContainer(PassRefPtr<MediaControlTextT rackContainerElement> textTrackContainer)
82 { 96 {
83 // Insert it before the overlay play button so it always displays behind it. 97 // Insert it before the overlay play button so it always displays behind it.
84 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); 98 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton);
85 } 99 }
86 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698