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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp

Issue 2417003002: [MediaControl] Hide overflow menu on window resize (Closed)
Patch Set: not polling Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
index c18500c12359fc92624b9256951c51196f504fc9..db2cc7b8a85f0b1c8dacb903d35dc42731049746 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
@@ -39,6 +39,8 @@ void MediaControlsWindowEventListener::start() {
if (LocalDOMWindow* window = getLocalDOMWindow()) {
window->addEventListener(EventTypeNames::click, this, false);
+ window->addEventListener(EventTypeNames::resize, this, false);
+
m_mediaControls->panelElement()->addEventListener(EventTypeNames::click,
this, false);
m_mediaControls->timelineElement()->addEventListener(EventTypeNames::click,
@@ -47,6 +49,7 @@ void MediaControlsWindowEventListener::start() {
EventTypeNames::click, this, false);
m_mediaControls->volumeSliderElement()->addEventListener(
EventTypeNames::click, this, false);
+
m_isActive = true;
}
}
@@ -57,6 +60,8 @@ void MediaControlsWindowEventListener::stop() {
if (LocalDOMWindow* window = getLocalDOMWindow()) {
window->removeEventListener(EventTypeNames::click, this, false);
+ window->removeEventListener(EventTypeNames::resize, this, false);
+
m_mediaControls->panelElement()->removeEventListener(EventTypeNames::click,
this, false);
m_mediaControls->timelineElement()->removeEventListener(
@@ -72,11 +77,9 @@ void MediaControlsWindowEventListener::stop() {
void MediaControlsWindowEventListener::handleEvent(
ExecutionContext* executionContext,
Event* event) {
- DCHECK(event->type() == EventTypeNames::click);
- handleClickEvent();
-}
+ DCHECK(event->type() == EventTypeNames::click ||
+ event->type() == EventTypeNames::resize);
-void MediaControlsWindowEventListener::handleClickEvent() {
if (!m_isActive)
return;
(*m_callback.get())();
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698