1 // Copyright 2014 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 "config.h" 6 #include "web/RemoteFrameClient.h" 7 8 #include "platform/weborigin/SecurityOrigin.h" 9 #include "web/WebLocalFrameImpl.h" 10 #include "web/WebRemoteFrameImpl.h" 11 12 namespace blink { 13 RemoteFrameClient(WebRemoteFrameImpl * webFrame)14RemoteFrameClient::RemoteFrameClient(WebRemoteFrameImpl* webFrame) 15 : m_webFrame(webFrame) 16 { 17 } 18 opener() const19Frame* RemoteFrameClient::opener() const 20 { 21 return toCoreFrame(m_webFrame->opener()); 22 } 23 setOpener(Frame *)24void RemoteFrameClient::setOpener(Frame*) 25 { 26 // FIXME: Implement. 27 } 28 parent() const29Frame* RemoteFrameClient::parent() const 30 { 31 return toCoreFrame(m_webFrame->parent()); 32 } 33 top() const34Frame* RemoteFrameClient::top() const 35 { 36 return toCoreFrame(m_webFrame->top()); 37 } 38 previousSibling() const39Frame* RemoteFrameClient::previousSibling() const 40 { 41 return toCoreFrame(m_webFrame->previousSibling()); 42 } 43 nextSibling() const44Frame* RemoteFrameClient::nextSibling() const 45 { 46 return toCoreFrame(m_webFrame->nextSibling()); 47 } 48 firstChild() const49Frame* RemoteFrameClient::firstChild() const 50 { 51 return toCoreFrame(m_webFrame->firstChild()); 52 } 53 lastChild() const54Frame* RemoteFrameClient::lastChild() const 55 { 56 return toCoreFrame(m_webFrame->lastChild()); 57 } 58 willCheckAndDispatchMessageEvent(SecurityOrigin * target,MessageEvent * event,LocalFrame * sourceFrame) const59bool RemoteFrameClient::willCheckAndDispatchMessageEvent( 60 SecurityOrigin* target, MessageEvent* event, LocalFrame* sourceFrame) const 61 { 62 if (m_webFrame->client()) 63 m_webFrame->client()->postMessageEvent(WebLocalFrameImpl::fromFrame(sourceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event)); 64 return true; 65 } 66 67 } // namespace blink 68