| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "platform/graphics/GraphicsContext.h" | 47 #include "platform/graphics/GraphicsContext.h" |
| 48 #include "platform/graphics/ImageBuffer.h" | 48 #include "platform/graphics/ImageBuffer.h" |
| 49 #include "platform/graphics/gpu/Extensions3DUtil.h" | 49 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 50 #include "public/platform/WebCanvas.h" | 50 #include "public/platform/WebCanvas.h" |
| 51 | 51 |
| 52 namespace blink { | 52 namespace blink { |
| 53 | 53 |
| 54 using namespace HTMLNames; | 54 using namespace HTMLNames; |
| 55 | 55 |
| 56 inline HTMLVideoElement::HTMLVideoElement(Document& document) | 56 inline HTMLVideoElement::HTMLVideoElement(Document& document) |
| 57 : HTMLMediaElement(videoTag, document), | 57 : HTMLMediaElement(videoTag, document) { |
| 58 m_customControlsFullscreenDetector( | |
| 59 new MediaCustomControlsFullscreenDetector(*this)) { | |
| 60 if (document.settings()) { | 58 if (document.settings()) { |
| 61 m_defaultPosterURL = | 59 m_defaultPosterURL = |
| 62 AtomicString(document.settings()->getDefaultVideoPosterURL()); | 60 AtomicString(document.settings()->getDefaultVideoPosterURL()); |
| 63 } | 61 } |
| 62 |
| 63 if (RuntimeEnabledFeatures::videoFullscreenDetectionEnabled()) { |
| 64 m_customControlsFullscreenDetector = |
| 65 new MediaCustomControlsFullscreenDetector(*this); |
| 66 } |
| 64 } | 67 } |
| 65 | 68 |
| 66 HTMLVideoElement* HTMLVideoElement::create(Document& document) { | 69 HTMLVideoElement* HTMLVideoElement::create(Document& document) { |
| 67 HTMLVideoElement* video = new HTMLVideoElement(document); | 70 HTMLVideoElement* video = new HTMLVideoElement(document); |
| 68 video->ensureUserAgentShadowRoot(); | 71 video->ensureUserAgentShadowRoot(); |
| 69 video->suspendIfNeeded(); | 72 video->suspendIfNeeded(); |
| 70 return video; | 73 return video; |
| 71 } | 74 } |
| 72 | 75 |
| 73 DEFINE_TRACE(HTMLVideoElement) { | 76 DEFINE_TRACE(HTMLVideoElement) { |
| 74 visitor->trace(m_imageLoader); | 77 visitor->trace(m_imageLoader); |
| 75 visitor->trace(m_customControlsFullscreenDetector); | 78 visitor->trace(m_customControlsFullscreenDetector); |
| 76 HTMLMediaElement::trace(visitor); | 79 HTMLMediaElement::trace(visitor); |
| 77 } | 80 } |
| 78 | 81 |
| 79 void HTMLVideoElement::contextDestroyed(ExecutionContext* context) { | 82 void HTMLVideoElement::contextDestroyed(ExecutionContext* context) { |
| 80 m_customControlsFullscreenDetector->contextDestroyed(); | 83 if (m_customControlsFullscreenDetector) |
| 84 m_customControlsFullscreenDetector->contextDestroyed(); |
| 85 |
| 81 HTMLMediaElement::contextDestroyed(context); | 86 HTMLMediaElement::contextDestroyed(context); |
| 82 } | 87 } |
| 83 | 88 |
| 84 bool HTMLVideoElement::layoutObjectIsNeeded(const ComputedStyle& style) { | 89 bool HTMLVideoElement::layoutObjectIsNeeded(const ComputedStyle& style) { |
| 85 return HTMLElement::layoutObjectIsNeeded(style); | 90 return HTMLElement::layoutObjectIsNeeded(style); |
| 86 } | 91 } |
| 87 | 92 |
| 88 LayoutObject* HTMLVideoElement::createLayoutObject(const ComputedStyle&) { | 93 LayoutObject* HTMLVideoElement::createLayoutObject(const ComputedStyle&) { |
| 89 return new LayoutVideo(this); | 94 return new LayoutVideo(this); |
| 90 } | 95 } |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 return ScriptPromise(); | 387 return ScriptPromise(); |
| 383 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) | 388 if (!ImageBitmap::isResizeOptionValid(options, exceptionState)) |
| 384 return ScriptPromise(); | 389 return ScriptPromise(); |
| 385 return ImageBitmapSource::fulfillImageBitmap( | 390 return ImageBitmapSource::fulfillImageBitmap( |
| 386 scriptState, | 391 scriptState, |
| 387 ImageBitmap::create(this, cropRect, | 392 ImageBitmap::create(this, cropRect, |
| 388 eventTarget.toLocalDOMWindow()->document(), options)); | 393 eventTarget.toLocalDOMWindow()->document(), options)); |
| 389 } | 394 } |
| 390 | 395 |
| 391 } // namespace blink | 396 } // namespace blink |
| OLD | NEW |