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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 Frame* parent = frame->tree().parent(); | 86 Frame* parent = frame->tree().parent(); |
87 if (!parent || !parent->isLocalFrame()) | 87 if (!parent || !parent->isLocalFrame()) |
88 return 1; | 88 return 1; |
89 return toLocalFrame(parent)->textZoomFactor(); | 89 return toLocalFrame(parent)->textZoomFactor(); |
90 } | 90 } |
91 | 91 |
92 inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host, FrameO wner* owner) | 92 inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host, FrameO wner* owner) |
93 : Frame(client, host, owner) | 93 : Frame(client, host, owner) |
94 , m_loader(this) | 94 , m_loader(this) |
95 , m_navigationScheduler(this) | 95 , m_navigationScheduler(this) |
96 , m_script(adoptPtr(new ScriptController(this))) | 96 , m_script(ScriptController::create(this)) |
97 , m_editor(Editor::create(*this)) | 97 , m_editor(Editor::create(*this)) |
98 , m_spellChecker(SpellChecker::create(*this)) | 98 , m_spellChecker(SpellChecker::create(*this)) |
99 , m_selection(FrameSelection::create(this)) | 99 , m_selection(FrameSelection::create(this)) |
100 , m_eventHandler(adoptPtrWillBeNoop(new EventHandler(this))) | 100 , m_eventHandler(adoptPtrWillBeNoop(new EventHandler(this))) |
101 , m_console(FrameConsole::create(*this)) | 101 , m_console(FrameConsole::create(*this)) |
102 , m_inputMethodController(InputMethodController::create(*this)) | 102 , m_inputMethodController(InputMethodController::create(*this)) |
103 , m_pageZoomFactor(parentPageZoomFactor(this)) | 103 , m_pageZoomFactor(parentPageZoomFactor(this)) |
104 , m_textZoomFactor(parentTextZoomFactor(this)) | 104 , m_textZoomFactor(parentTextZoomFactor(this)) |
105 , m_inViewSourceMode(false) | 105 , m_inViewSourceMode(false) |
106 { | 106 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 (*it)->frameDestroyed(); | 138 (*it)->frameDestroyed(); |
139 #endif | 139 #endif |
140 } | 140 } |
141 | 141 |
142 void LocalFrame::trace(Visitor* visitor) | 142 void LocalFrame::trace(Visitor* visitor) |
143 { | 143 { |
144 #if ENABLE(OILPAN) | 144 #if ENABLE(OILPAN) |
145 visitor->trace(m_destructionObservers); | 145 visitor->trace(m_destructionObservers); |
146 visitor->trace(m_loader); | 146 visitor->trace(m_loader); |
147 visitor->trace(m_navigationScheduler); | 147 visitor->trace(m_navigationScheduler); |
148 visitor->trace(m_view); | |
148 visitor->trace(m_pagePopupOwner); | 149 visitor->trace(m_pagePopupOwner); |
149 visitor->trace(m_editor); | 150 visitor->trace(m_editor); |
150 visitor->trace(m_spellChecker); | 151 visitor->trace(m_spellChecker); |
151 visitor->trace(m_selection); | 152 visitor->trace(m_selection); |
152 visitor->trace(m_eventHandler); | 153 visitor->trace(m_eventHandler); |
153 visitor->trace(m_console); | 154 visitor->trace(m_console); |
154 visitor->trace(m_inputMethodController); | 155 visitor->trace(m_inputMethodController); |
155 HeapSupplementable<LocalFrame>::trace(visitor); | 156 HeapSupplementable<LocalFrame>::trace(visitor); |
156 #endif | 157 #endif |
157 Frame::trace(visitor); | 158 Frame::trace(visitor); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 { | 195 { |
195 // We detach the FrameView's custom scroll bars as early as | 196 // We detach the FrameView's custom scroll bars as early as |
196 // possible to prevent m_doc->detach() from messing with the view | 197 // possible to prevent m_doc->detach() from messing with the view |
197 // such that its scroll bars won't be torn down. | 198 // such that its scroll bars won't be torn down. |
198 // | 199 // |
199 // FIXME: We should revisit this. | 200 // FIXME: We should revisit this. |
200 if (m_view) | 201 if (m_view) |
201 m_view->prepareForDetach(); | 202 m_view->prepareForDetach(); |
202 } | 203 } |
203 | 204 |
204 void LocalFrame::setView(PassRefPtr<FrameView> view) | 205 void LocalFrame::setView(PassRefPtrWillBeRawPtr<FrameView> view) |
205 { | 206 { |
206 detachView(); | 207 detachView(); |
207 | 208 |
208 // Prepare for destruction now, so any unload event handlers get run and the LocalDOMWindow is | 209 // Prepare for destruction now, so any unload event handlers get run and the LocalDOMWindow is |
209 // notified. If we wait until the view is destroyed, then things won't be ho oked up enough for | 210 // notified. If we wait until the view is destroyed, then things won't be ho oked up enough for |
210 // these calls to work. | 211 // these calls to work. |
211 if (!view && document() && document()->isActive()) { | 212 if (!view && document() && document()->isActive()) { |
212 // FIXME: We don't call willRemove here. Why is that OK? | 213 // FIXME: We don't call willRemove here. Why is that OK? |
213 document()->prepareForDestruction(); | 214 document()->prepareForDestruction(); |
214 } | 215 } |
215 | 216 |
216 eventHandler().clear(); | 217 eventHandler().clear(); |
217 | 218 |
219 if (m_view && !view) | |
haraken
2014/09/29 14:16:36
What is the '&& !view' check for?
How about calli
haraken
2014/10/03 15:02:58
Would you reply to this question?
sof
2014/10/07 11:03:36
I've now tweaked the predicate.
| |
220 m_view->dispose(); | |
221 | |
218 m_view = view; | 222 m_view = view; |
219 | 223 |
220 if (m_view && isMainFrame()) { | 224 if (m_view && isMainFrame()) { |
221 if (settings()->pinchVirtualViewportEnabled()) | 225 if (settings()->pinchVirtualViewportEnabled()) |
222 m_host->pinchViewport().mainFrameDidChangeSize(); | 226 m_host->pinchViewport().mainFrameDidChangeSize(); |
223 else | 227 else |
224 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); | 228 m_view->setVisibleContentScaleFactor(page()->pageScaleFactor()); |
225 } | 229 } |
226 } | 230 } |
227 | 231 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 ASSERT(this); | 439 ASSERT(this); |
436 ASSERT(page()); | 440 ASSERT(page()); |
437 | 441 |
438 bool isLocalRoot = this->isLocalRoot(); | 442 bool isLocalRoot = this->isLocalRoot(); |
439 | 443 |
440 if (isLocalRoot && view()) | 444 if (isLocalRoot && view()) |
441 view()->setParentVisible(false); | 445 view()->setParentVisible(false); |
442 | 446 |
443 setView(nullptr); | 447 setView(nullptr); |
444 | 448 |
445 RefPtr<FrameView> frameView; | 449 RefPtrWillBeRawPtr<FrameView> frameView = nullptr; |
446 if (isLocalRoot) { | 450 if (isLocalRoot) { |
447 frameView = FrameView::create(this, viewportSize); | 451 frameView = FrameView::create(this, viewportSize); |
448 | 452 |
449 // The layout size is set by WebViewImpl to support @viewport | 453 // The layout size is set by WebViewImpl to support @viewport |
450 frameView->setLayoutSizeFixedToFrameSize(false); | 454 frameView->setLayoutSizeFixedToFrameSize(false); |
451 } else | 455 } else |
452 frameView = FrameView::create(this); | 456 frameView = FrameView::create(this); |
453 | 457 |
454 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock); | 458 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, horizontalLock, verticalLock); |
455 | 459 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 | 739 |
736 return curFrame; | 740 return curFrame; |
737 } | 741 } |
738 | 742 |
739 void LocalFrame::setPagePopupOwner(Element& owner) | 743 void LocalFrame::setPagePopupOwner(Element& owner) |
740 { | 744 { |
741 m_pagePopupOwner = &owner; | 745 m_pagePopupOwner = &owner; |
742 } | 746 } |
743 | 747 |
744 } // namespace blink | 748 } // namespace blink |
OLD | NEW |