OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "WebFrameletImpl.h" |
| 6 |
| 7 #include "core/html/HTMLFrameletElement.h" |
| 8 #include "public/web/WebFrameletClient.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 WebFramelet* WebFramelet::create(WebFrameletClient* client) |
| 13 { |
| 14 return WebFrameletImpl::create(client); |
| 15 } |
| 16 |
| 17 WebFrameletImpl::WebFrameletImpl(WebFrameletClient* client) |
| 18 : m_frameletClient(FrameletClientImpl::create(this)) |
| 19 , m_client(client) |
| 20 { |
| 21 ASSERT(client); |
| 22 } |
| 23 |
| 24 WebFrameletImpl::~WebFrameletImpl() |
| 25 { |
| 26 } |
| 27 |
| 28 WebFrameletImpl* WebFrameletImpl::create(WebFrameletClient* client) |
| 29 { |
| 30 WebFrameletImpl* frame = new WebFrameletImpl(client); |
| 31 #if ENABLE(OILPAN) |
| 32 return frame; |
| 33 #else |
| 34 return adoptRef(frame).leakRef(); |
| 35 #endif |
| 36 } |
| 37 |
| 38 void WebFrameletImpl::close() |
| 39 { |
| 40 #if ENABLE(OILPAN) |
| 41 m_selfKeepAlive.clear(); |
| 42 #else |
| 43 deref(); |
| 44 #endif |
| 45 } |
| 46 |
| 47 void WebFrameletImpl::setWebLayer(WebLayer* webLayer) |
| 48 { |
| 49 if (!framelet()) |
| 50 return; |
| 51 |
| 52 framelet()->setRemotePlatformLayer(webLayer); |
| 53 } |
| 54 |
| 55 WebFrameletClient* WebFrameletImpl::client() |
| 56 { |
| 57 return m_client; |
| 58 } |
| 59 |
| 60 void WebFrameletImpl::initializeCoreFramelet(FrameOwner* owner) |
| 61 { |
| 62 setCoreFramelet(Framelet::create(m_frameletClient.get(), owner)); |
| 63 framelet()->createView(); |
| 64 } |
| 65 |
| 66 void WebFrameletImpl::setCoreFramelet(PassRefPtrWillBeRawPtr<Framelet> framelet) |
| 67 { |
| 68 m_framelet = framelet; |
| 69 } |
| 70 |
| 71 } // namespace blink |
OLD | NEW |