summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
blob: f4c9176abab01f0b2fe6c11251c180fe198da8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "config.h"
#include "core/frame/RemoteFrame.h"

#include "core/frame/RemoteFrameView.h"
#include "core/html/HTMLFrameOwnerElement.h"

namespace WebCore {

inline RemoteFrame::RemoteFrame(FrameClient* client, FrameHost* host, FrameOwner* owner)
    : Frame(client, host, owner)
{
}

PassRefPtr<RemoteFrame> RemoteFrame::create(FrameClient* client, FrameHost* host, FrameOwner* owner)
{
    RefPtr<RemoteFrame> frame = adoptRef(new RemoteFrame(client, host, owner));
    return frame.release();
}

RemoteFrame::~RemoteFrame()
{
    setView(nullptr);
}

void RemoteFrame::setView(PassRefPtr<RemoteFrameView> view)
{
    m_view = view;
}

void RemoteFrame::createView()
{
    RefPtr<RemoteFrameView> view = RemoteFrameView::create(this);
    setView(view);

    if (ownerRenderer()) {
        HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
        ASSERT(owner);
        owner->setWidget(view);
    }
}

} // namespace WebCore