| 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 | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 9 * rights reserved. | 9 * rights reserved. |
| 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 m_loader.clear(); | 426 m_loader.clear(); |
| 427 if (!client()) | 427 if (!client()) |
| 428 return; | 428 return; |
| 429 | 429 |
| 430 client()->willBeDetached(); | 430 client()->willBeDetached(); |
| 431 // Notify ScriptController that the frame is closing, since its cleanup ends | 431 // Notify ScriptController that the frame is closing, since its cleanup ends |
| 432 // up calling back to LocalFrameClient via WindowProxy. | 432 // up calling back to LocalFrameClient via WindowProxy. |
| 433 script().clearForClose(); | 433 script().clearForClose(); |
| 434 setView(nullptr); | 434 setView(nullptr); |
| 435 | 435 |
| 436 m_host->page().eventHandlerRegistry().didRemoveAllEventHandlers(*domWindow()); | 436 m_page->eventHandlerRegistry().didRemoveAllEventHandlers(*domWindow()); |
| 437 | 437 |
| 438 domWindow()->frameDestroyed(); | 438 domWindow()->frameDestroyed(); |
| 439 | 439 |
| 440 // TODO: Page should take care of updating focus/scrolling instead of Frame. | 440 // TODO: Page should take care of updating focus/scrolling instead of Frame. |
| 441 // TODO: It's unclear as to why this is called more than once, but it is, | 441 // TODO: It's unclear as to why this is called more than once, but it is, |
| 442 // so page() could be null. | 442 // so page() could be null. |
| 443 if (page() && page()->focusController().focusedFrame() == this) | 443 if (page() && page()->focusController().focusedFrame() == this) |
| 444 page()->focusController().setFocusedFrame(nullptr); | 444 page()->focusController().setFocusedFrame(nullptr); |
| 445 | 445 |
| 446 if (page() && page()->scrollingCoordinator() && m_view) | 446 if (page() && page()->scrollingCoordinator() && m_view) |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 SubtreeStyleChange, | 699 SubtreeStyleChange, |
| 700 StyleChangeReasonForTracing::create(StyleChangeReason::Zoom)); | 700 StyleChangeReasonForTracing::create(StyleChangeReason::Zoom)); |
| 701 for (Frame* child = tree().firstChild(); child; | 701 for (Frame* child = tree().firstChild(); child; |
| 702 child = child->tree().nextSibling()) { | 702 child = child->tree().nextSibling()) { |
| 703 if (child->isLocalFrame()) | 703 if (child->isLocalFrame()) |
| 704 toLocalFrame(child)->deviceScaleFactorChanged(); | 704 toLocalFrame(child)->deviceScaleFactorChanged(); |
| 705 } | 705 } |
| 706 } | 706 } |
| 707 | 707 |
| 708 double LocalFrame::devicePixelRatio() const { | 708 double LocalFrame::devicePixelRatio() const { |
| 709 if (!m_host) | 709 if (!m_page) |
| 710 return 0; | 710 return 0; |
| 711 | 711 |
| 712 double ratio = m_host->page().deviceScaleFactorDeprecated(); | 712 double ratio = m_page->deviceScaleFactorDeprecated(); |
| 713 ratio *= pageZoomFactor(); | 713 ratio *= pageZoomFactor(); |
| 714 return ratio; | 714 return ratio; |
| 715 } | 715 } |
| 716 | 716 |
| 717 std::unique_ptr<DragImage> LocalFrame::nodeImage(Node& node) { | 717 std::unique_ptr<DragImage> LocalFrame::nodeImage(Node& node) { |
| 718 DraggedNodeImageBuilder imageNode(*this, node); | 718 DraggedNodeImageBuilder imageNode(*this, node); |
| 719 return imageNode.createImage(); | 719 return imageNode.createImage(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 std::unique_ptr<DragImage> LocalFrame::dragImageForSelection(float opacity) { | 722 std::unique_ptr<DragImage> LocalFrame::dragImageForSelection(float opacity) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 841 |
| 842 bool LocalFrame::shouldThrottleRendering() const { | 842 bool LocalFrame::shouldThrottleRendering() const { |
| 843 return view() && view()->shouldThrottleRendering(); | 843 return view() && view()->shouldThrottleRendering(); |
| 844 } | 844 } |
| 845 | 845 |
| 846 inline LocalFrame::LocalFrame(LocalFrameClient* client, | 846 inline LocalFrame::LocalFrame(LocalFrameClient* client, |
| 847 FrameHost* host, | 847 FrameHost* host, |
| 848 FrameOwner* owner, | 848 FrameOwner* owner, |
| 849 InterfaceProvider* interfaceProvider, | 849 InterfaceProvider* interfaceProvider, |
| 850 InterfaceRegistry* interfaceRegistry) | 850 InterfaceRegistry* interfaceRegistry) |
| 851 : Frame(client, host, owner, LocalWindowProxyManager::create(*this)), | 851 : Frame(client, |
| 852 host ? &host->page() : nullptr, |
| 853 owner, |
| 854 LocalWindowProxyManager::create(*this)), |
| 852 m_frameScheduler(page()->chromeClient().createFrameScheduler( | 855 m_frameScheduler(page()->chromeClient().createFrameScheduler( |
| 853 client->frameBlameContext())), | 856 client->frameBlameContext())), |
| 854 m_loader(this), | 857 m_loader(this), |
| 855 m_navigationScheduler(NavigationScheduler::create(this)), | 858 m_navigationScheduler(NavigationScheduler::create(this)), |
| 856 m_script(ScriptController::create( | 859 m_script(ScriptController::create( |
| 857 *this, | 860 *this, |
| 858 *static_cast<LocalWindowProxyManager*>(getWindowProxyManager()))), | 861 *static_cast<LocalWindowProxyManager*>(getWindowProxyManager()))), |
| 859 m_editor(Editor::create(*this)), | 862 m_editor(Editor::create(*this)), |
| 860 m_spellChecker(SpellChecker::create(*this)), | 863 m_spellChecker(SpellChecker::create(*this)), |
| 861 m_selection(FrameSelection::create(*this)), | 864 m_selection(FrameSelection::create(*this)), |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 916 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 914 m_frame->client()->frameBlameContext()->Enter(); | 917 m_frame->client()->frameBlameContext()->Enter(); |
| 915 } | 918 } |
| 916 | 919 |
| 917 ScopedFrameBlamer::~ScopedFrameBlamer() { | 920 ScopedFrameBlamer::~ScopedFrameBlamer() { |
| 918 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) | 921 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) |
| 919 m_frame->client()->frameBlameContext()->Leave(); | 922 m_frame->client()->frameBlameContext()->Leave(); |
| 920 } | 923 } |
| 921 | 924 |
| 922 } // namespace blink | 925 } // namespace blink |
| OLD | NEW |