OLD | NEW |
---|---|
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 |
(...skipping 16 matching lines...) Expand all Loading... | |
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 "bindings/core/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
31 #include "core/dom/ClientRect.h" | 31 #include "core/dom/ClientRect.h" |
32 #include "core/events/MouseEvent.h" | 32 #include "core/events/MouseEvent.h" |
33 #include "core/frame/Settings.h" | 33 #include "core/frame/Settings.h" |
34 #include "core/html/HTMLMediaElement.h" | 34 #include "core/html/HTMLMediaElement.h" |
35 #include "core/html/MediaController.h" | 35 #include "core/html/MediaController.h" |
36 #include "core/layout/LayoutTheme.h" | 36 #include "core/layout/LayoutTheme.h" |
37 #include "core/page/EventHandler.h" | |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 // If you change this value, then also update the corresponding value in | 41 // If you change this value, then also update the corresponding value in |
41 // LayoutTests/media/media-controls.js. | 42 // LayoutTests/media/media-controls.js. |
42 static const double timeWithoutMouseMovementBeforeHidingMediaControls = 3; | 43 static const double timeWithoutMouseMovementBeforeHidingMediaControls = 3; |
43 | 44 |
44 static bool fullscreenIsSupported(const Document& document) | 45 static bool fullscreenIsSupported(const Document& document) |
45 { | 46 { |
46 return !document.settings() || document.settings()->fullscreenSupported(); | 47 return !document.settings() || document.settings()->fullscreenSupported(); |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 m_castButton->setIsPlayingRemotely(false); | 435 m_castButton->setIsPlayingRemotely(false); |
435 m_overlayCastButton->setIsPlayingRemotely(false); | 436 m_overlayCastButton->setIsPlayingRemotely(false); |
436 } | 437 } |
437 | 438 |
438 void MediaControls::defaultEventHandler(Event* event) | 439 void MediaControls::defaultEventHandler(Event* event) |
439 { | 440 { |
440 HTMLDivElement::defaultEventHandler(event); | 441 HTMLDivElement::defaultEventHandler(event); |
441 m_wasLastEventTouch = event->isTouchEvent() || event->isGestureEvent() | 442 m_wasLastEventTouch = event->isTouchEvent() || event->isGestureEvent() |
442 || (event->isMouseEvent() && toMouseEvent(event)->fromTouch()); | 443 || (event->isMouseEvent() && toMouseEvent(event)->fromTouch()); |
443 | 444 |
445 if (m_wasLastEventTouch && document().frame()) | |
446 document().frame()->eventHandler().scheduleHoverStateUpdate(); | |
philipj_slow
2015/02/05 08:14:32
Does this actually work? Is the problem that the h
| |
447 | |
444 if (event->type() == EventTypeNames::mouseover) { | 448 if (event->type() == EventTypeNames::mouseover) { |
445 if (!containsRelatedTarget(event)) { | 449 if (!containsRelatedTarget(event)) { |
446 m_isMouseOverControls = true; | 450 m_isMouseOverControls = true; |
447 if (!mediaElement().togglePlayStateWillPlay()) { | 451 if (!mediaElement().togglePlayStateWillPlay()) { |
448 makeOpaque(); | 452 makeOpaque(); |
449 if (shouldHideMediaControls()) | 453 if (shouldHideMediaControls()) |
450 startHideMediaControlsTimer(); | 454 startHideMediaControlsTimer(); |
451 } | 455 } |
452 } | 456 } |
453 return; | 457 return; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 visitor->trace(m_toggleClosedCaptionsButton); | 569 visitor->trace(m_toggleClosedCaptionsButton); |
566 visitor->trace(m_fullScreenButton); | 570 visitor->trace(m_fullScreenButton); |
567 visitor->trace(m_durationDisplay); | 571 visitor->trace(m_durationDisplay); |
568 visitor->trace(m_enclosure); | 572 visitor->trace(m_enclosure); |
569 visitor->trace(m_castButton); | 573 visitor->trace(m_castButton); |
570 visitor->trace(m_overlayCastButton); | 574 visitor->trace(m_overlayCastButton); |
571 HTMLDivElement::trace(visitor); | 575 HTMLDivElement::trace(visitor); |
572 } | 576 } |
573 | 577 |
574 } | 578 } |
OLD | NEW |