OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999-2001 Lars Knoll <knoll@kde.org> | 3 * 1999-2001 Lars Knoll <knoll@kde.org> |
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> | 4 * 1999-2001 Antti Koivisto <koivisto@kde.org> |
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> | 5 * 2000-2001 Simon Hausmann <hausmann@kde.org> |
6 * 2000-2001 Dirk Mueller <mueller@kde.org> | 6 * 2000-2001 Dirk Mueller <mueller@kde.org> |
7 * 2000 Stefan Schimanski <1Stein@gmx.de> | 7 * 2000 Stefan Schimanski <1Stein@gmx.de> |
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 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) | 9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 class Color; | 48 class Color; |
49 class DOMWindow; | 49 class DOMWindow; |
50 class Document; | 50 class Document; |
51 class DragImage; | 51 class DragImage; |
52 class Editor; | 52 class Editor; |
53 class Element; | 53 class Element; |
54 class EventHandler; | 54 class EventHandler; |
55 class FetchContext; | 55 class FetchContext; |
56 class FloatSize; | 56 class FloatSize; |
57 class FrameDestructionObserver; | 57 class FrameDestructionObserver; |
| 58 class FrameHost; |
58 class FrameSelection; | 59 class FrameSelection; |
59 class FrameView; | 60 class FrameView; |
60 class HTMLFrameOwnerElement; | 61 class HTMLFrameOwnerElement; |
61 class HTMLTableCellElement; | 62 class HTMLTableCellElement; |
62 class InputMethodController; | 63 class InputMethodController; |
63 class IntPoint; | 64 class IntPoint; |
64 class Node; | 65 class Node; |
| 66 class Page; |
65 class Range; | 67 class Range; |
66 class RenderPart; | 68 class RenderPart; |
67 class RenderView; | 69 class RenderView; |
68 class TreeScope; | 70 class TreeScope; |
69 class ScriptController; | 71 class ScriptController; |
70 class Settings; | 72 class Settings; |
71 class SpellChecker; | 73 class SpellChecker; |
72 class TreeScope; | 74 class TreeScope; |
73 class VisiblePosition; | 75 class VisiblePosition; |
74 class Widget; | 76 class Widget; |
75 | 77 |
76 class FrameInit : public RefCounted<FrameInit> { | 78 class FrameInit : public RefCounted<FrameInit> { |
77 public: | 79 public: |
78 // For creating a dummy Frame | 80 // For creating a dummy Frame |
79 static PassRefPtr<FrameInit> create(int64_t frameID, Page* page, FrameLo
aderClient* client) | 81 static PassRefPtr<FrameInit> create(int64_t frameID, FrameHost* host, Fr
ameLoaderClient* client) |
80 { | 82 { |
81 return adoptRef(new FrameInit(frameID, page, client)); | 83 return adoptRef(new FrameInit(frameID, host, client)); |
82 } | 84 } |
83 | 85 |
| 86 int64_t frameID() const { return m_frameID; } |
| 87 |
| 88 void setFrameHost(FrameHost* host) { m_frameHost = host; } |
| 89 FrameHost* frameHost() const { return m_frameHost; } |
| 90 |
84 void setFrameLoaderClient(FrameLoaderClient* client) { m_client = client
; } | 91 void setFrameLoaderClient(FrameLoaderClient* client) { m_client = client
; } |
85 FrameLoaderClient* frameLoaderClient() const { return m_client; } | 92 FrameLoaderClient* frameLoaderClient() const { return m_client; } |
86 | 93 |
87 int64_t frameID() const { return m_frameID; } | |
88 | |
89 void setPage(Page* page) { m_page = page; } | |
90 Page* page() const { return m_page; } | |
91 | |
92 void setOwnerElement(HTMLFrameOwnerElement* ownerElement) { m_ownerEleme
nt = ownerElement; } | 94 void setOwnerElement(HTMLFrameOwnerElement* ownerElement) { m_ownerEleme
nt = ownerElement; } |
93 HTMLFrameOwnerElement* ownerElement() const { return m_ownerElement; } | 95 HTMLFrameOwnerElement* ownerElement() const { return m_ownerElement; } |
94 | 96 |
95 protected: | 97 protected: |
96 FrameInit(int64_t frameID, Page* page = 0, FrameLoaderClient* client = 0
) | 98 FrameInit(int64_t frameID, FrameHost* host = 0, FrameLoaderClient* clien
t = 0) |
97 : m_frameID(frameID) | 99 : m_frameID(frameID) |
98 , m_client(client) | 100 , m_client(client) |
99 , m_page(page) | 101 , m_frameHost(host) |
100 , m_ownerElement(0) | 102 , m_ownerElement(0) |
101 { | 103 { |
102 } | 104 } |
103 | 105 |
104 private: | 106 private: |
105 int64_t m_frameID; | 107 int64_t m_frameID; |
106 FrameLoaderClient* m_client; | 108 FrameLoaderClient* m_client; |
107 Page* m_page; | 109 FrameHost* m_frameHost; |
108 HTMLFrameOwnerElement* m_ownerElement; | 110 HTMLFrameOwnerElement* m_ownerElement; |
109 }; | 111 }; |
110 | 112 |
111 class Frame : public RefCounted<Frame> { | 113 class Frame : public RefCounted<Frame> { |
112 public: | 114 public: |
113 static PassRefPtr<Frame> create(PassRefPtr<FrameInit>); | 115 static PassRefPtr<Frame> create(PassRefPtr<FrameInit>); |
114 | 116 |
115 void init(); | 117 void init(); |
116 void setView(PassRefPtr<FrameView>); | 118 void setView(PassRefPtr<FrameView>); |
117 void createView(const IntSize&, const Color&, bool, | 119 void createView(const IntSize&, const Color&, bool, |
118 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, | 120 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, |
119 ScrollbarMode = ScrollbarAuto, bool verticalLock = false); | 121 ScrollbarMode = ScrollbarAuto, bool verticalLock = false); |
120 | 122 |
121 ~Frame(); | 123 ~Frame(); |
122 | 124 |
123 void addDestructionObserver(FrameDestructionObserver*); | 125 void addDestructionObserver(FrameDestructionObserver*); |
124 void removeDestructionObserver(FrameDestructionObserver*); | 126 void removeDestructionObserver(FrameDestructionObserver*); |
125 | 127 |
126 void willDetachPage(); | 128 void willDetachFrameHost(); |
127 void detachFromPage(); | 129 void detachFromFrameHost(); |
128 void disconnectOwnerElement(); | 130 void disconnectOwnerElement(); |
129 | 131 |
| 132 // NOTE: Page is moving out of Blink up into the browser process as |
| 133 // part of the site-isolation (out of process iframes) work. |
| 134 // FrameHost should be used in stead where possible. |
130 Page* page() const; | 135 Page* page() const; |
| 136 FrameHost* host() const; // Null when the frame is detached. |
| 137 |
131 HTMLFrameOwnerElement* ownerElement() const; | 138 HTMLFrameOwnerElement* ownerElement() const; |
132 bool isMainFrame() const; | 139 bool isMainFrame() const; |
133 | 140 |
134 void setDOMWindow(PassRefPtr<DOMWindow>); | 141 void setDOMWindow(PassRefPtr<DOMWindow>); |
135 DOMWindow* domWindow() const; | 142 DOMWindow* domWindow() const; |
136 Document* document() const; | 143 Document* document() const; |
137 FrameView* view() const; | 144 FrameView* view() const; |
138 | 145 |
139 ChromeClient& chromeClient() const; | 146 ChromeClient& chromeClient() const; |
140 Editor& editor() const; | 147 Editor& editor() const; |
141 EventHandler& eventHandler() const; | 148 EventHandler& eventHandler() const; |
142 FrameLoader& loader() const; | 149 FrameLoader& loader() const; |
143 NavigationScheduler& navigationScheduler() const; | 150 NavigationScheduler& navigationScheduler() const; |
144 FrameSelection& selection() const; | 151 FrameSelection& selection() const; |
145 FrameTree& tree() const; | 152 FrameTree& tree() const; |
146 AnimationController& animation() const; | 153 AnimationController& animation() const; |
147 InputMethodController& inputMethodController() const; | 154 InputMethodController& inputMethodController() const; |
148 FetchContext& fetchContext() const { return loader().fetchContext(); } | 155 FetchContext& fetchContext() const { return loader().fetchContext(); } |
149 ScriptController& script(); | 156 ScriptController& script(); |
150 SpellChecker& spellChecker() const; | 157 SpellChecker& spellChecker() const; |
151 | 158 |
152 RenderView* contentRenderer() const; // Root of the render tree for the
document contained in this frame. | 159 RenderView* contentRenderer() const; // Root of the render tree for the
document contained in this frame. |
153 RenderPart* ownerRenderer() const; // Renderer for the element that cont
ains this frame. | 160 RenderPart* ownerRenderer() const; // Renderer for the element that cont
ains this frame. |
154 | 161 |
155 void dispatchVisibilityStateChangeEvent(); | 162 void dispatchVisibilityStateChangeEvent(); |
156 | 163 |
157 int64_t frameID() const { return m_frameInit->frameID(); } | 164 int64_t frameID() const { return m_frameInit->frameID(); } |
158 | 165 |
| 166 // FIXME: These should move to RemoteFrame once that exists. |
| 167 // RemotePlatformLayer is only ever set for Frames which exist in anothe
r process. |
159 void setRemotePlatformLayer(blink::WebLayer* remotePlatformLayer) { m_re
motePlatformLayer = remotePlatformLayer; } | 168 void setRemotePlatformLayer(blink::WebLayer* remotePlatformLayer) { m_re
motePlatformLayer = remotePlatformLayer; } |
160 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLa
yer; } | 169 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLa
yer; } |
161 | 170 |
162 // ======== All public functions below this point are candidates to move out
of Frame into another class. ======== | 171 // ======== All public functions below this point are candidates to move out
of Frame into another class. ======== |
163 | 172 |
164 bool inScope(TreeScope*) const; | 173 bool inScope(TreeScope*) const; |
165 | 174 |
166 // See GraphicsLayerClient.h for accepted flags. | 175 // See GraphicsLayerClient.h for accepted flags. |
167 String layerTreeAsText(unsigned flags = 0) const; | 176 String layerTreeAsText(unsigned flags = 0) const; |
168 String trackedRepaintRectsAsText() const; | 177 String trackedRepaintRectsAsText() const; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 219 |
211 bool isURLAllowed(const KURL&) const; | 220 bool isURLAllowed(const KURL&) const; |
212 | 221 |
213 // ======== | 222 // ======== |
214 | 223 |
215 private: | 224 private: |
216 Frame(PassRefPtr<FrameInit>); | 225 Frame(PassRefPtr<FrameInit>); |
217 | 226 |
218 HashSet<FrameDestructionObserver*> m_destructionObservers; | 227 HashSet<FrameDestructionObserver*> m_destructionObservers; |
219 | 228 |
220 Page* m_page; | 229 FrameHost* m_host; |
221 mutable FrameTree m_treeNode; | 230 mutable FrameTree m_treeNode; |
222 mutable FrameLoader m_loader; | 231 mutable FrameLoader m_loader; |
223 mutable NavigationScheduler m_navigationScheduler; | 232 mutable NavigationScheduler m_navigationScheduler; |
224 | 233 |
225 RefPtr<FrameView> m_view; | 234 RefPtr<FrameView> m_view; |
226 RefPtr<DOMWindow> m_domWindow; | 235 RefPtr<DOMWindow> m_domWindow; |
227 | 236 |
228 OwnPtr<ScriptController> m_script; | 237 OwnPtr<ScriptController> m_script; |
229 const OwnPtr<Editor> m_editor; | 238 const OwnPtr<Editor> m_editor; |
230 const OwnPtr<SpellChecker> m_spellChecker; | 239 const OwnPtr<SpellChecker> m_spellChecker; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 inline void Frame::setInViewSourceMode(bool mode) | 324 inline void Frame::setInViewSourceMode(bool mode) |
316 { | 325 { |
317 m_inViewSourceMode = mode; | 326 m_inViewSourceMode = mode; |
318 } | 327 } |
319 | 328 |
320 inline FrameTree& Frame::tree() const | 329 inline FrameTree& Frame::tree() const |
321 { | 330 { |
322 return m_treeNode; | 331 return m_treeNode; |
323 } | 332 } |
324 | 333 |
325 inline Page* Frame::page() const | |
326 { | |
327 return m_page; | |
328 } | |
329 | |
330 inline EventHandler& Frame::eventHandler() const | 334 inline EventHandler& Frame::eventHandler() const |
331 { | 335 { |
332 ASSERT(m_eventHandler); | 336 ASSERT(m_eventHandler); |
333 return *m_eventHandler; | 337 return *m_eventHandler; |
334 } | 338 } |
335 | 339 |
336 } // namespace WebCore | 340 } // namespace WebCore |
337 | 341 |
338 #endif // Frame_h | 342 #endif // Frame_h |
OLD | NEW |