Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2702273004: bindings: Simplifies WindowProxyManager and its relation to Frame. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 visitor->trace(m_spellChecker); 356 visitor->trace(m_spellChecker);
357 visitor->trace(m_selection); 357 visitor->trace(m_selection);
358 visitor->trace(m_eventHandler); 358 visitor->trace(m_eventHandler);
359 visitor->trace(m_console); 359 visitor->trace(m_console);
360 visitor->trace(m_inputMethodController); 360 visitor->trace(m_inputMethodController);
361 visitor->trace(m_idleSpellCheckCallback); 361 visitor->trace(m_idleSpellCheckCallback);
362 Frame::trace(visitor); 362 Frame::trace(visitor);
363 Supplementable<LocalFrame>::trace(visitor); 363 Supplementable<LocalFrame>::trace(visitor);
364 } 364 }
365 365
366 WindowProxy* LocalFrame::windowProxy(DOMWrapperWorld& world) {
367 return m_script->windowProxy(world);
368 }
369
370 void LocalFrame::navigate(Document& originDocument, 366 void LocalFrame::navigate(Document& originDocument,
371 const KURL& url, 367 const KURL& url,
372 bool replaceCurrentItem, 368 bool replaceCurrentItem,
373 UserGestureStatus userGestureStatus) { 369 UserGestureStatus userGestureStatus) {
374 m_navigationScheduler->scheduleLocationChange(&originDocument, url, 370 m_navigationScheduler->scheduleLocationChange(&originDocument, url,
375 replaceCurrentItem); 371 replaceCurrentItem);
376 } 372 }
377 373
378 void LocalFrame::navigate(const FrameLoadRequest& request) { 374 void LocalFrame::navigate(const FrameLoadRequest& request) {
379 m_loader.load(request); 375 m_loader.load(request);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 document()->url().getString() + "'. " + reason + "\n"; 484 document()->url().getString() + "'. " + reason + "\n";
489 485
490 domWindow()->printErrorMessage(message); 486 domWindow()->printErrorMessage(message);
491 } 487 }
492 488
493 void LocalFrame::printNavigationWarning(const String& message) { 489 void LocalFrame::printNavigationWarning(const String& message) {
494 m_console->addMessage( 490 m_console->addMessage(
495 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); 491 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message));
496 } 492 }
497 493
498 WindowProxyManagerBase* LocalFrame::getWindowProxyManager() const {
499 return m_script->getWindowProxyManager();
500 }
501
502 bool LocalFrame::shouldClose() { 494 bool LocalFrame::shouldClose() {
503 // TODO(dcheng): This should be fixed to dispatch beforeunload events to 495 // TODO(dcheng): This should be fixed to dispatch beforeunload events to
504 // both local and remote frames. 496 // both local and remote frames.
505 return m_loader.shouldClose(); 497 return m_loader.shouldClose();
506 } 498 }
507 499
508 void LocalFrame::detachChildren() { 500 void LocalFrame::detachChildren() {
509 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document()); 501 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
510 502
511 if (Document* document = this->document()) 503 if (Document* document = this->document())
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 838
847 bool LocalFrame::shouldThrottleRendering() const { 839 bool LocalFrame::shouldThrottleRendering() const {
848 return view() && view()->shouldThrottleRendering(); 840 return view() && view()->shouldThrottleRendering();
849 } 841 }
850 842
851 inline LocalFrame::LocalFrame(FrameLoaderClient* client, 843 inline LocalFrame::LocalFrame(FrameLoaderClient* client,
852 FrameHost* host, 844 FrameHost* host,
853 FrameOwner* owner, 845 FrameOwner* owner,
854 InterfaceProvider* interfaceProvider, 846 InterfaceProvider* interfaceProvider,
855 InterfaceRegistry* interfaceRegistry) 847 InterfaceRegistry* interfaceRegistry)
856 : Frame(client, host, owner), 848 : Frame(client, host, owner, LocalWindowProxyManager::create(*this)),
857 m_frameScheduler(page()->chromeClient().createFrameScheduler( 849 m_frameScheduler(page()->chromeClient().createFrameScheduler(
858 client->frameBlameContext())), 850 client->frameBlameContext())),
859 m_loader(this), 851 m_loader(this),
860 m_navigationScheduler(NavigationScheduler::create(this)), 852 m_navigationScheduler(NavigationScheduler::create(this)),
861 m_script(ScriptController::create(this)), 853 m_script(ScriptController::create(
854 static_cast<LocalWindowProxyManager*>(getWindowProxyManager()))),
862 m_editor(Editor::create(*this)), 855 m_editor(Editor::create(*this)),
863 m_spellChecker(SpellChecker::create(*this)), 856 m_spellChecker(SpellChecker::create(*this)),
864 m_selection(FrameSelection::create(*this)), 857 m_selection(FrameSelection::create(*this)),
865 m_eventHandler(new EventHandler(*this)), 858 m_eventHandler(new EventHandler(*this)),
866 m_console(FrameConsole::create(*this)), 859 m_console(FrameConsole::create(*this)),
867 m_inputMethodController(InputMethodController::create(*this)), 860 m_inputMethodController(InputMethodController::create(*this)),
868 m_idleSpellCheckCallback(IdleSpellCheckCallback::create(*this)), 861 m_idleSpellCheckCallback(IdleSpellCheckCallback::create(*this)),
869 m_navigationDisableCount(0), 862 m_navigationDisableCount(0),
870 m_pageZoomFactor(parentPageZoomFactor(this)), 863 m_pageZoomFactor(parentPageZoomFactor(this)),
871 m_textZoomFactor(parentTextZoomFactor(this)), 864 m_textZoomFactor(parentTextZoomFactor(this)),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 910 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
918 m_frame->client()->frameBlameContext()->Enter(); 911 m_frame->client()->frameBlameContext()->Enter();
919 } 912 }
920 913
921 ScopedFrameBlamer::~ScopedFrameBlamer() { 914 ScopedFrameBlamer::~ScopedFrameBlamer() {
922 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 915 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
923 m_frame->client()->frameBlameContext()->Leave(); 916 m_frame->client()->frameBlameContext()->Leave();
924 } 917 }
925 918
926 } // namespace blink 919 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698