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 20 matching lines...) Expand all Loading... |
31 #include "core/html/shadow/MediaControlElements.h" | 31 #include "core/html/shadow/MediaControlElements.h" |
32 | 32 |
33 #include "RuntimeEnabledFeatures.h" | 33 #include "RuntimeEnabledFeatures.h" |
34 #include "bindings/v8/ExceptionStatePlaceholder.h" | 34 #include "bindings/v8/ExceptionStatePlaceholder.h" |
35 #include "core/dom/DOMTokenList.h" | 35 #include "core/dom/DOMTokenList.h" |
36 #include "core/dom/FullscreenElementStack.h" | 36 #include "core/dom/FullscreenElementStack.h" |
37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
38 #include "core/events/MouseEvent.h" | 38 #include "core/events/MouseEvent.h" |
39 #include "core/events/ThreadLocalEventNames.h" | 39 #include "core/events/ThreadLocalEventNames.h" |
40 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
41 #include "core/frame/Settings.h" | |
42 #include "core/html/HTMLVideoElement.h" | 41 #include "core/html/HTMLVideoElement.h" |
43 #include "core/html/shadow/MediaControls.h" | 42 #include "core/html/shadow/MediaControls.h" |
44 #include "core/html/track/TextTrack.h" | 43 #include "core/html/track/TextTrack.h" |
45 #include "core/html/track/vtt/VTTRegionList.h" | 44 #include "core/html/track/vtt/VTTRegionList.h" |
46 #include "core/page/EventHandler.h" | 45 #include "core/page/EventHandler.h" |
47 #include "core/rendering/RenderMediaControlElements.h" | 46 #include "core/rendering/RenderMediaControlElements.h" |
48 #include "core/rendering/RenderSlider.h" | 47 #include "core/rendering/RenderSlider.h" |
49 #include "core/rendering/RenderTheme.h" | 48 #include "core/rendering/RenderTheme.h" |
50 #include "core/rendering/RenderVideo.h" | 49 #include "core/rendering/RenderVideo.h" |
51 | 50 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 RefPtr<MediaControlFullscreenButtonElement> button = adoptRef(new MediaContr
olFullscreenButtonElement(mediaControls)); | 580 RefPtr<MediaControlFullscreenButtonElement> button = adoptRef(new MediaContr
olFullscreenButtonElement(mediaControls)); |
582 button->ensureUserAgentShadowRoot(); | 581 button->ensureUserAgentShadowRoot(); |
583 button->setType("button"); | 582 button->setType("button"); |
584 button->hide(); | 583 button->hide(); |
585 return button.release(); | 584 return button.release(); |
586 } | 585 } |
587 | 586 |
588 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) | 587 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) |
589 { | 588 { |
590 if (event->type() == EventTypeNames::click) { | 589 if (event->type() == EventTypeNames::click) { |
591 // Only use the new full screen API if the fullScreenEnabled setting has | 590 if (FullscreenElementStack::isActiveFullScreenElement(&mediaElement())) |
592 // been explicitly enabled. Otherwise, use the old fullscreen API. This | 591 FullscreenElementStack::from(document()).webkitCancelFullScreen(); |
593 // allows apps which embed a WebView to retain the existing full screen | 592 else |
594 // video implementation without requiring them to implement their own fu
ll | 593 FullscreenElementStack::from(document()).requestFullScreenForElement
(&mediaElement(), 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirem
ent); |
595 // screen behavior. | |
596 if (document().settings() && document().settings()->fullScreenEnabled())
{ | |
597 if (FullscreenElementStack::isActiveFullScreenElement(&mediaElement(
))) | |
598 FullscreenElementStack::from(document()).webkitCancelFullScreen(
); | |
599 else | |
600 FullscreenElementStack::from(document()).requestFullScreenForEle
ment(&mediaElement(), 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequ
irement); | |
601 } else { | |
602 mediaControllerInterface().enterFullscreen(); | |
603 } | |
604 event->setDefaultHandled(); | 594 event->setDefaultHandled(); |
605 } | 595 } |
606 HTMLInputElement::defaultEventHandler(event); | 596 HTMLInputElement::defaultEventHandler(event); |
607 } | 597 } |
608 | 598 |
609 const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const | 599 const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const |
610 { | 600 { |
611 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-fullscreen-bu
tton", AtomicString::ConstructFromLiteral)); | 601 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-fullscreen-bu
tton", AtomicString::ConstructFromLiteral)); |
612 return id; | 602 return id; |
613 } | 603 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 float fontSize = smallestDimension * 0.05f; | 772 float fontSize = smallestDimension * 0.05f; |
783 if (fontSize != m_fontSize) { | 773 if (fontSize != m_fontSize) { |
784 m_fontSize = fontSize; | 774 m_fontSize = fontSize; |
785 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); | 775 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue:
:CSS_PX); |
786 } | 776 } |
787 } | 777 } |
788 | 778 |
789 // ---------------------------- | 779 // ---------------------------- |
790 | 780 |
791 } // namespace WebCore | 781 } // namespace WebCore |
OLD | NEW |