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

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

Issue 2417003002: [MediaControl] Hide overflow menu on window resize (Closed)
Patch Set: 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
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 4f266eceb3cd9708b378312ee24b463e341769f3..99faf013d1cc1cd44409f9934206d5deaa276a6e 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.cpp
@@ -39,6 +39,7 @@ void MediaControlsWindowEventListener::start() {
if (LocalDOMWindow* window = getLocalDOMWindow()) {
window->addEventListener(EventTypeNames::click, this, false);
+ window->addEventListener(EventTypeNames::resize, this, false);
m_isActive = true;
}
}
@@ -47,19 +48,19 @@ void MediaControlsWindowEventListener::stop() {
if (!m_isActive)
return;
- if (LocalDOMWindow* window = getLocalDOMWindow())
+ if (LocalDOMWindow* window = getLocalDOMWindow()) {
window->removeEventListener(EventTypeNames::click, this, false);
+ window->removeEventListener(EventTypeNames::resize, this, false);
+ }
m_isActive = false;
}
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())();

Powered by Google App Engine
This is Rietveld 408576698