OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/html/shadow/MediaControlElements.h" | 31 #include "core/html/shadow/MediaControlElements.h" |
32 | 32 |
33 #include "bindings/v8/ExceptionStatePlaceholder.h" | 33 #include "bindings/v8/ExceptionStatePlaceholder.h" |
34 #include "core/dom/DOMTokenList.h" | 34 #include "core/dom/DOMTokenList.h" |
35 #include "core/dom/FullscreenElementStack.h" | |
36 #include "core/dom/shadow/ShadowRoot.h" | 35 #include "core/dom/shadow/ShadowRoot.h" |
37 #include "core/events/MouseEvent.h" | 36 #include "core/events/MouseEvent.h" |
38 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
39 #include "core/html/HTMLVideoElement.h" | 38 #include "core/html/HTMLVideoElement.h" |
40 #include "core/html/MediaController.h" | 39 #include "core/html/MediaController.h" |
41 #include "core/html/shadow/MediaControls.h" | 40 #include "core/html/shadow/MediaControls.h" |
42 #include "core/html/track/TextTrack.h" | 41 #include "core/html/track/TextTrack.h" |
43 #include "core/html/track/vtt/VTTRegionList.h" | 42 #include "core/html/track/vtt/VTTRegionList.h" |
44 #include "core/page/EventHandler.h" | 43 #include "core/page/EventHandler.h" |
45 #include "core/rendering/RenderMediaControlElements.h" | 44 #include "core/rendering/RenderMediaControlElements.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> button = adoptRefWil
lBeNoop(new MediaControlFullscreenButtonElement(mediaControls)); | 484 RefPtrWillBeRawPtr<MediaControlFullscreenButtonElement> button = adoptRefWil
lBeNoop(new MediaControlFullscreenButtonElement(mediaControls)); |
486 button->ensureUserAgentShadowRoot(); | 485 button->ensureUserAgentShadowRoot(); |
487 button->setType("button"); | 486 button->setType("button"); |
488 button->hide(); | 487 button->hide(); |
489 return button.release(); | 488 return button.release(); |
490 } | 489 } |
491 | 490 |
492 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) | 491 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) |
493 { | 492 { |
494 if (event->type() == EventTypeNames::click) { | 493 if (event->type() == EventTypeNames::click) { |
495 if (FullscreenElementStack::isActiveFullScreenElement(mediaElement())) | 494 if (mediaElement().isFullscreen()) |
496 FullscreenElementStack::from(document()).webkitCancelFullScreen(); | 495 mediaElement().exitFullscreen(); |
497 else | 496 else |
498 FullscreenElementStack::from(document()).requestFullScreenForElement
(mediaElement(), 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequireme
nt); | 497 mediaElement().enterFullscreen(); |
499 event->setDefaultHandled(); | 498 event->setDefaultHandled(); |
500 } | 499 } |
501 HTMLInputElement::defaultEventHandler(event); | 500 HTMLInputElement::defaultEventHandler(event); |
502 } | 501 } |
503 | 502 |
504 const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const | 503 const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const |
505 { | 504 { |
506 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-fullscreen-bu
tton", AtomicString::ConstructFromLiteral)); | 505 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-fullscreen-bu
tton", AtomicString::ConstructFromLiteral)); |
507 return id; | 506 return id; |
508 } | 507 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 float fontSize = smallestDimension * 0.05f; | 675 float fontSize = smallestDimension * 0.05f; |
677 if (fontSize != m_fontSize) { | 676 if (fontSize != m_fontSize) { |
678 m_fontSize = fontSize; | 677 m_fontSize = fontSize; |
679 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 678 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
680 } | 679 } |
681 } | 680 } |
682 | 681 |
683 // ---------------------------- | 682 // ---------------------------- |
684 | 683 |
685 } // namespace WebCore | 684 } // namespace WebCore |
OLD | NEW |