2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA.
31 #include "heap/Handle.h"
32 #include "wtf/Forward.h"
33 #include "wtf/HashSet.h"
34 #include "wtf/RefCounted.h"
45 class FrameDestructionObserver;
47 class HTMLFrameOwnerElement;
52 class Frame : public RefCounted<Frame> {
54 virtual bool isLocalFrame() const { return false; }
55 virtual bool isRemoteFrame() const { return false; }
59 void addDestructionObserver(FrameDestructionObserver*);
60 void removeDestructionObserver(FrameDestructionObserver*);
62 virtual void willDetachFrameHost();
63 virtual void detachFromFrameHost();
65 // NOTE: Page is moving out of Blink up into the browser process as
66 // part of the site-isolation (out of process iframes) work.
67 // FrameHost should be used instead where possible.
69 FrameHost* host() const; // Null when the frame is detached.
71 bool isMainFrame() const;
73 // FIXME: DOMWindow and Document should both be moved to LocalFrame
74 // after RemoteFrame is complete enough to exist without them.
75 virtual void setDOMWindow(PassRefPtrWillBeRawPtr<DOMWindow>);
76 DOMWindow* domWindow() const;
77 Document* document() const;
79 ChromeClient& chromeClient() const;
81 RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
83 int64_t frameID() const { return m_frameID; }
85 // FIXME: These should move to RemoteFrame when that is instantiated.
86 void setRemotePlatformLayer(blink::WebLayer* remotePlatformLayer) { m_remotePlatformLayer = remotePlatformLayer; }
87 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
89 Settings* settings() const; // can be null
92 Frame(FrameHost*, HTMLFrameOwnerElement*);
95 HTMLFrameOwnerElement* m_ownerElement;
97 RefPtrWillBePersistent<DOMWindow> m_domWindow;
101 HashSet<FrameDestructionObserver*> m_destructionObservers;
103 // Temporary hack for history.
106 blink::WebLayer* m_remotePlatformLayer;
109 inline DOMWindow* Frame::domWindow() const
111 return m_domWindow.get();
113 } // namespace WebCore