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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class RenderPart; | 61 class RenderPart; |
62 class RenderView; | 62 class RenderView; |
63 class TreeScope; | 63 class TreeScope; |
64 class ScriptController; | 64 class ScriptController; |
65 class Settings; | 65 class Settings; |
66 class SpellChecker; | 66 class SpellChecker; |
67 class TreeScope; | 67 class TreeScope; |
68 class VisiblePosition; | 68 class VisiblePosition; |
69 class Widget; | 69 class Widget; |
70 | 70 |
| 71 class FrameInit : public RefCounted<FrameInit> { |
| 72 public: |
| 73 // For creating a dummy Frame |
| 74 static PassRefPtr<FrameInit> create(int64_t frameID, Page* page, FrameLo
aderClient* client) |
| 75 { |
| 76 return adoptRef(new FrameInit(frameID, page, client)); |
| 77 } |
| 78 |
| 79 void setFrameLoaderClient(FrameLoaderClient* client) { m_client = client
; } |
| 80 FrameLoaderClient* frameLoaderClient() const { return m_client; } |
| 81 |
| 82 int64_t frameID() const { return m_frameID; } |
| 83 |
| 84 void setPage(Page* page) { m_page = page; } |
| 85 Page* page() const { return m_page; } |
| 86 |
| 87 void setOwnerElement(HTMLFrameOwnerElement* ownerElement) { m_ownerEleme
nt = ownerElement; } |
| 88 HTMLFrameOwnerElement* ownerElement() const { return m_ownerElement; } |
| 89 |
| 90 protected: |
| 91 FrameInit(int64_t frameID, Page* page = 0, FrameLoaderClient* client = 0
) |
| 92 : m_frameID(frameID) |
| 93 , m_client(client) |
| 94 , m_page(page) |
| 95 , m_ownerElement(0) |
| 96 { |
| 97 } |
| 98 |
| 99 private: |
| 100 int64_t m_frameID; |
| 101 FrameLoaderClient* m_client; |
| 102 Page* m_page; |
| 103 HTMLFrameOwnerElement* m_ownerElement; |
| 104 }; |
| 105 |
71 class Frame : public RefCounted<Frame> { | 106 class Frame : public RefCounted<Frame> { |
72 public: | 107 public: |
73 static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoad
erClient*); | 108 static PassRefPtr<Frame> create(PassRefPtr<FrameInit>); |
74 | 109 |
75 void init(); | 110 void init(); |
76 void setView(PassRefPtr<FrameView>); | 111 void setView(PassRefPtr<FrameView>); |
77 void createView(const IntSize&, const Color&, bool, | 112 void createView(const IntSize&, const Color&, bool, |
78 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, | 113 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, |
79 ScrollbarMode = ScrollbarAuto, bool verticalLock = false); | 114 ScrollbarMode = ScrollbarAuto, bool verticalLock = false); |
80 | 115 |
81 ~Frame(); | 116 ~Frame(); |
82 | 117 |
83 void addDestructionObserver(FrameDestructionObserver*); | 118 void addDestructionObserver(FrameDestructionObserver*); |
(...skipping 21 matching lines...) Expand all Loading... |
105 InputMethodController& inputMethodController() const; | 140 InputMethodController& inputMethodController() const; |
106 FetchContext& fetchContext() const { return loader().fetchContext(); } | 141 FetchContext& fetchContext() const { return loader().fetchContext(); } |
107 ScriptController& script(); | 142 ScriptController& script(); |
108 SpellChecker& spellChecker() const; | 143 SpellChecker& spellChecker() const; |
109 | 144 |
110 RenderView* contentRenderer() const; // Root of the render tree for the
document contained in this frame. | 145 RenderView* contentRenderer() const; // Root of the render tree for the
document contained in this frame. |
111 RenderPart* ownerRenderer() const; // Renderer for the element that cont
ains this frame. | 146 RenderPart* ownerRenderer() const; // Renderer for the element that cont
ains this frame. |
112 | 147 |
113 void dispatchVisibilityStateChangeEvent(); | 148 void dispatchVisibilityStateChangeEvent(); |
114 | 149 |
| 150 int64_t frameID() const { return m_frameInit->frameID(); } |
| 151 |
115 // ======== All public functions below this point are candidates to move out
of Frame into another class. ======== | 152 // ======== All public functions below this point are candidates to move out
of Frame into another class. ======== |
116 | 153 |
117 bool inScope(TreeScope*) const; | 154 bool inScope(TreeScope*) const; |
118 | 155 |
119 // See GraphicsLayerClient.h for accepted flags. | 156 // See GraphicsLayerClient.h for accepted flags. |
120 String layerTreeAsText(unsigned flags = 0) const; | 157 String layerTreeAsText(unsigned flags = 0) const; |
121 String trackedRepaintRectsAsText() const; | 158 String trackedRepaintRectsAsText() const; |
122 | 159 |
123 Settings* settings() const; // can be NULL | 160 Settings* settings() const; // can be NULL |
124 | 161 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 PassRefPtr<Range> rangeForPoint(const IntPoint& framePoint); | 196 PassRefPtr<Range> rangeForPoint(const IntPoint& framePoint); |
160 | 197 |
161 // Should only be called on the main frame of a page. | 198 // Should only be called on the main frame of a page. |
162 void notifyChromeClientWheelEventHandlerCountChanged() const; | 199 void notifyChromeClientWheelEventHandlerCountChanged() const; |
163 | 200 |
164 bool isURLAllowed(const KURL&) const; | 201 bool isURLAllowed(const KURL&) const; |
165 | 202 |
166 // ======== | 203 // ======== |
167 | 204 |
168 private: | 205 private: |
169 Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*); | 206 Frame(PassRefPtr<FrameInit>); |
170 | 207 |
171 HashSet<FrameDestructionObserver*> m_destructionObservers; | 208 HashSet<FrameDestructionObserver*> m_destructionObservers; |
172 | 209 |
173 Page* m_page; | 210 Page* m_page; |
174 mutable FrameTree m_treeNode; | 211 mutable FrameTree m_treeNode; |
175 mutable FrameLoader m_loader; | 212 mutable FrameLoader m_loader; |
176 mutable NavigationScheduler m_navigationScheduler; | 213 mutable NavigationScheduler m_navigationScheduler; |
177 | 214 |
178 HTMLFrameOwnerElement* m_ownerElement; | |
179 RefPtr<FrameView> m_view; | 215 RefPtr<FrameView> m_view; |
180 RefPtr<DOMWindow> m_domWindow; | 216 RefPtr<DOMWindow> m_domWindow; |
181 | 217 |
182 OwnPtr<ScriptController> m_script; | 218 OwnPtr<ScriptController> m_script; |
183 const OwnPtr<Editor> m_editor; | 219 const OwnPtr<Editor> m_editor; |
184 const OwnPtr<SpellChecker> m_spellChecker; | 220 const OwnPtr<SpellChecker> m_spellChecker; |
185 const OwnPtr<FrameSelection> m_selection; | 221 const OwnPtr<FrameSelection> m_selection; |
186 const OwnPtr<EventHandler> m_eventHandler; | 222 const OwnPtr<EventHandler> m_eventHandler; |
187 OwnPtr<AnimationController> m_animationController; | 223 OwnPtr<AnimationController> m_animationController; |
188 OwnPtr<InputMethodController> m_inputMethodController; | 224 OwnPtr<InputMethodController> m_inputMethodController; |
189 | 225 |
| 226 RefPtr<FrameInit> m_frameInit; |
| 227 |
190 float m_pageZoomFactor; | 228 float m_pageZoomFactor; |
191 float m_textZoomFactor; | 229 float m_textZoomFactor; |
192 | 230 |
193 #if ENABLE(ORIENTATION_EVENTS) | 231 #if ENABLE(ORIENTATION_EVENTS) |
194 int m_orientation; | 232 int m_orientation; |
195 #endif | 233 #endif |
196 | 234 |
197 bool m_inViewSourceMode; | 235 bool m_inViewSourceMode; |
198 }; | 236 }; |
199 | 237 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 return *m_animationController; | 285 return *m_animationController; |
248 } | 286 } |
249 | 287 |
250 inline InputMethodController& Frame::inputMethodController() const | 288 inline InputMethodController& Frame::inputMethodController() const |
251 { | 289 { |
252 return *m_inputMethodController; | 290 return *m_inputMethodController; |
253 } | 291 } |
254 | 292 |
255 inline HTMLFrameOwnerElement* Frame::ownerElement() const | 293 inline HTMLFrameOwnerElement* Frame::ownerElement() const |
256 { | 294 { |
257 return m_ownerElement; | 295 return m_frameInit->ownerElement(); |
258 } | 296 } |
259 | 297 |
260 inline bool Frame::inViewSourceMode() const | 298 inline bool Frame::inViewSourceMode() const |
261 { | 299 { |
262 return m_inViewSourceMode; | 300 return m_inViewSourceMode; |
263 } | 301 } |
264 | 302 |
265 inline void Frame::setInViewSourceMode(bool mode) | 303 inline void Frame::setInViewSourceMode(bool mode) |
266 { | 304 { |
267 m_inViewSourceMode = mode; | 305 m_inViewSourceMode = mode; |
(...skipping 11 matching lines...) Expand all Loading... |
279 | 317 |
280 inline EventHandler& Frame::eventHandler() const | 318 inline EventHandler& Frame::eventHandler() const |
281 { | 319 { |
282 ASSERT(m_eventHandler); | 320 ASSERT(m_eventHandler); |
283 return *m_eventHandler; | 321 return *m_eventHandler; |
284 } | 322 } |
285 | 323 |
286 } // namespace WebCore | 324 } // namespace WebCore |
287 | 325 |
288 #endif // Frame_h | 326 #endif // Frame_h |
OLD | NEW |