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.
6 #include "web/RemoteFrameClient.h"
8 #include "platform/weborigin/SecurityOrigin.h"
9 #include "web/WebLocalFrameImpl.h"
10 #include "web/WebRemoteFrameImpl.h"
14 RemoteFrameClient::RemoteFrameClient(WebRemoteFrameImpl* webFrame)
15 : m_webFrame(webFrame)
19 Frame* RemoteFrameClient::opener() const
21 return toCoreFrame(m_webFrame->opener());
24 void RemoteFrameClient::setOpener(Frame*)
29 Frame* RemoteFrameClient::parent() const
31 return toCoreFrame(m_webFrame->parent());
34 Frame* RemoteFrameClient::top() const
36 return toCoreFrame(m_webFrame->top());
39 Frame* RemoteFrameClient::previousSibling() const
41 return toCoreFrame(m_webFrame->previousSibling());
44 Frame* RemoteFrameClient::nextSibling() const
46 return toCoreFrame(m_webFrame->nextSibling());
49 Frame* RemoteFrameClient::firstChild() const
51 return toCoreFrame(m_webFrame->firstChild());
54 Frame* RemoteFrameClient::lastChild() const
56 return toCoreFrame(m_webFrame->lastChild());
59 bool RemoteFrameClient::willCheckAndDispatchMessageEvent(
60 SecurityOrigin* target, MessageEvent* event, LocalFrame* sourceFrame) const
62 if (m_webFrame->client())
63 m_webFrame->client()->postMessageEvent(WebLocalFrameImpl::fromFrame(sourceFrame), m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event));