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 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
(...skipping 15 matching lines...) Expand all Loading... |
26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 26 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 * Boston, MA 02110-1301, USA. | 27 * Boston, MA 02110-1301, USA. |
28 */ | 28 */ |
29 | 29 |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/frame/Frame.h" | 31 #include "core/frame/Frame.h" |
32 | 32 |
33 #include "core/dom/DocumentType.h" | 33 #include "core/dom/DocumentType.h" |
34 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
35 #include "core/frame/LocalDOMWindow.h" | 35 #include "core/frame/LocalDOMWindow.h" |
36 #include "core/frame/FrameDestructionObserver.h" | |
37 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
38 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
39 #include "core/html/HTMLFrameElementBase.h" | 38 #include "core/html/HTMLFrameElementBase.h" |
40 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
41 #include "core/loader/EmptyClients.h" | 40 #include "core/loader/EmptyClients.h" |
42 #include "core/loader/FrameLoaderClient.h" | 41 #include "core/loader/FrameLoaderClient.h" |
43 #include "core/page/Chrome.h" | 42 #include "core/page/Chrome.h" |
44 #include "core/page/ChromeClient.h" | 43 #include "core/page/ChromeClient.h" |
45 #include "core/page/EventHandler.h" | 44 #include "core/page/EventHandler.h" |
46 #include "core/page/FocusController.h" | 45 #include "core/page/FocusController.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 Frame::~Frame() | 82 Frame::~Frame() |
84 { | 83 { |
85 disconnectOwnerElement(); | 84 disconnectOwnerElement(); |
86 setDOMWindow(nullptr); | 85 setDOMWindow(nullptr); |
87 | 86 |
88 // FIXME: We should not be doing all this work inside the destructor | 87 // FIXME: We should not be doing all this work inside the destructor |
89 | 88 |
90 #ifndef NDEBUG | 89 #ifndef NDEBUG |
91 frameCounter.decrement(); | 90 frameCounter.decrement(); |
92 #endif | 91 #endif |
93 | |
94 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e
nd(); | |
95 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver
s.begin(); it != stop; ++it) | |
96 (*it)->frameDestroyed(); | |
97 } | |
98 | |
99 void Frame::addDestructionObserver(FrameDestructionObserver* observer) | |
100 { | |
101 m_destructionObservers.add(observer); | |
102 } | |
103 | |
104 void Frame::removeDestructionObserver(FrameDestructionObserver* observer) | |
105 { | |
106 m_destructionObservers.remove(observer); | |
107 } | 92 } |
108 | 93 |
109 FrameHost* Frame::host() const | 94 FrameHost* Frame::host() const |
110 { | 95 { |
111 return m_host; | 96 return m_host; |
112 } | 97 } |
113 | 98 |
114 Page* Frame::page() const | 99 Page* Frame::page() const |
115 { | 100 { |
116 if (m_host) | 101 if (m_host) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 m_remotePlatformLayer = layer; | 153 m_remotePlatformLayer = layer; |
169 if (m_remotePlatformLayer) | 154 if (m_remotePlatformLayer) |
170 GraphicsLayer::registerContentsLayer(layer); | 155 GraphicsLayer::registerContentsLayer(layer); |
171 | 156 |
172 ASSERT(owner()); | 157 ASSERT(owner()); |
173 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 158 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
174 if (RenderPart* renderer = ownerRenderer()) | 159 if (RenderPart* renderer = ownerRenderer()) |
175 renderer->layer()->updateSelfPaintingLayer(); | 160 renderer->layer()->updateSelfPaintingLayer(); |
176 } | 161 } |
177 | 162 |
178 void Frame::willDetachFrameHost() | |
179 { | |
180 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e
nd(); | |
181 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver
s.begin(); it != stop; ++it) | |
182 (*it)->willDetachFrameHost(); | |
183 | |
184 // FIXME: Page should take care of updating focus/scrolling instead of Frame
. | |
185 // FIXME: It's unclear as to why this is called more than once, but it is, | |
186 // so page() could be null. | |
187 if (page() && page()->focusController().focusedFrame() == this) | |
188 page()->focusController().setFocusedFrame(nullptr); | |
189 } | |
190 | |
191 void Frame::detachFromFrameHost() | |
192 { | |
193 m_host = 0; | |
194 } | |
195 | |
196 bool Frame::isMainFrame() const | 163 bool Frame::isMainFrame() const |
197 { | 164 { |
198 Page* page = this->page(); | 165 Page* page = this->page(); |
199 return page && this == page->mainFrame(); | 166 return page && this == page->mainFrame(); |
200 } | 167 } |
201 | 168 |
202 bool Frame::isLocalRoot() const | 169 bool Frame::isLocalRoot() const |
203 { | 170 { |
204 if (isRemoteFrame()) | 171 if (isRemoteFrame()) |
205 return false; | 172 return false; |
(...skipping 14 matching lines...) Expand all Loading... |
220 } | 187 } |
221 m_owner = 0; | 188 m_owner = 0; |
222 } | 189 } |
223 | 190 |
224 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const | 191 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |
225 { | 192 { |
226 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; | 193 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; |
227 } | 194 } |
228 | 195 |
229 } // namespace blink | 196 } // namespace blink |
OLD | NEW |