OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ModulesInitializer.h" | 5 #include "ModulesInitializer.h" |
6 | 6 |
7 #include "bindings/modules/v8/ModuleBindingsInitializer.h" | 7 #include "bindings/modules/v8/ModuleBindingsInitializer.h" |
8 #include "core/EventTypeNames.h" | 8 #include "core/EventTypeNames.h" |
9 #include "core/css/CSSPaintImageGenerator.h" | 9 #include "core/css/CSSPaintImageGenerator.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
11 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
12 #include "core/html/HTMLCanvasElement.h" | 12 #include "core/html/HTMLCanvasElement.h" |
13 #include "core/html/HTMLMediaElement.h" | 13 #include "core/html/HTMLMediaElement.h" |
14 #include "core/offscreencanvas/OffscreenCanvas.h" | 14 #include "core/offscreencanvas/OffscreenCanvas.h" |
15 #include "modules/EventModulesFactory.h" | 15 #include "modules/EventModulesFactory.h" |
16 #include "modules/EventModulesNames.h" | 16 #include "modules/EventModulesNames.h" |
17 #include "modules/EventTargetModulesNames.h" | 17 #include "modules/EventTargetModulesNames.h" |
18 #include "modules/IndexedDBNames.h" | 18 #include "modules/IndexedDBNames.h" |
19 #include "modules/accessibility/AXObjectCacheImpl.h" | 19 #include "modules/accessibility/AXObjectCacheImpl.h" |
20 #include "modules/app_banner/AppBannerController.h" | 20 #include "modules/app_banner/AppBannerController.h" |
21 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 21 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
22 #include "modules/compositorworker/CompositorWorkerThread.h" | 22 #include "modules/compositorworker/CompositorWorkerThread.h" |
23 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" | 23 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" |
| 24 #include "modules/document_metadata/CopylessPasteServer.h" |
24 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" | 25 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" |
25 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" | 26 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" |
26 #include "modules/installation/InstallationServiceImpl.h" | 27 #include "modules/installation/InstallationServiceImpl.h" |
27 #include "modules/media_controls/MediaControlsImpl.h" | 28 #include "modules/media_controls/MediaControlsImpl.h" |
28 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" | 29 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" |
29 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h" | 30 #include "modules/time_zone_monitor/TimeZoneMonitorClient.h" |
30 #include "modules/webdatabase/DatabaseManager.h" | 31 #include "modules/webdatabase/DatabaseManager.h" |
31 #include "modules/webgl/WebGL2RenderingContext.h" | 32 #include "modules/webgl/WebGL2RenderingContext.h" |
32 #include "modules/webgl/WebGLRenderingContext.h" | 33 #include "modules/webgl/WebGLRenderingContext.h" |
33 #include "platform/mojo/MojoHelper.h" | 34 #include "platform/mojo/MojoHelper.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // OffscreenCanvas context types must be registered with the OffscreenCanvas. | 77 // OffscreenCanvas context types must be registered with the OffscreenCanvas. |
77 OffscreenCanvas::registerRenderingContextFactory( | 78 OffscreenCanvas::registerRenderingContextFactory( |
78 WTF::makeUnique<OffscreenCanvasRenderingContext2D::Factory>()); | 79 WTF::makeUnique<OffscreenCanvasRenderingContext2D::Factory>()); |
79 OffscreenCanvas::registerRenderingContextFactory( | 80 OffscreenCanvas::registerRenderingContextFactory( |
80 WTF::makeUnique<WebGLRenderingContext::Factory>()); | 81 WTF::makeUnique<WebGLRenderingContext::Factory>()); |
81 OffscreenCanvas::registerRenderingContextFactory( | 82 OffscreenCanvas::registerRenderingContextFactory( |
82 WTF::makeUnique<WebGL2RenderingContext::Factory>()); | 83 WTF::makeUnique<WebGL2RenderingContext::Factory>()); |
83 | 84 |
84 // Mojo Interfaces registered with LocalFrame | 85 // Mojo Interfaces registered with LocalFrame |
85 LocalFrame::registerInitializationCallback([](LocalFrame* frame) { | 86 LocalFrame::registerInitializationCallback([](LocalFrame* frame) { |
| 87 if (frame && frame->isMainFrame()) { |
| 88 frame->interfaceRegistry()->addInterface(WTF::bind( |
| 89 &CopylessPasteServer::bindMojoRequest, wrapWeakPersistent(frame))); |
| 90 } |
86 frame->interfaceRegistry()->addInterface( | 91 frame->interfaceRegistry()->addInterface( |
87 WTF::bind(&InstallationServiceImpl::create, wrapWeakPersistent(frame))); | 92 WTF::bind(&InstallationServiceImpl::create, wrapWeakPersistent(frame))); |
88 // TODO(dominickn): This interface should be document-scoped rather than | 93 // TODO(dominickn): This interface should be document-scoped rather than |
89 // frame-scoped, as the resulting banner event is dispatched to | 94 // frame-scoped, as the resulting banner event is dispatched to |
90 // frame()->document(). | 95 // frame()->document(). |
91 frame->interfaceRegistry()->addInterface(WTF::bind( | 96 frame->interfaceRegistry()->addInterface(WTF::bind( |
92 &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame))); | 97 &AppBannerController::bindMojoRequest, wrapWeakPersistent(frame))); |
93 }); | 98 }); |
94 | 99 |
95 HTMLMediaElement::registerMediaControlsFactory( | 100 HTMLMediaElement::registerMediaControlsFactory( |
96 WTF::makeUnique<MediaControlsImpl::Factory>()); | 101 WTF::makeUnique<MediaControlsImpl::Factory>()); |
97 | 102 |
98 ASSERT(isInitialized()); | 103 ASSERT(isInitialized()); |
99 } | 104 } |
100 | 105 |
101 } // namespace blink | 106 } // namespace blink |
OLD | NEW |