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

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

Issue 2630693002: Make ScriptController inherit LocalWindowProxyManager
Patch Set: rebase Created 3 years, 11 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 visitor->trace(m_spellChecker); 355 visitor->trace(m_spellChecker);
356 visitor->trace(m_selection); 356 visitor->trace(m_selection);
357 visitor->trace(m_eventHandler); 357 visitor->trace(m_eventHandler);
358 visitor->trace(m_console); 358 visitor->trace(m_console);
359 visitor->trace(m_inputMethodController); 359 visitor->trace(m_inputMethodController);
360 visitor->trace(m_idleSpellCheckCallback); 360 visitor->trace(m_idleSpellCheckCallback);
361 Frame::trace(visitor); 361 Frame::trace(visitor);
362 Supplementable<LocalFrame>::trace(visitor); 362 Supplementable<LocalFrame>::trace(visitor);
363 } 363 }
364 364
365 WindowProxy* LocalFrame::windowProxy(DOMWrapperWorld& world) {
366 return m_script->windowProxy(world);
367 }
368
369 void LocalFrame::navigate(Document& originDocument, 365 void LocalFrame::navigate(Document& originDocument,
370 const KURL& url, 366 const KURL& url,
371 bool replaceCurrentItem, 367 bool replaceCurrentItem,
372 UserGestureStatus userGestureStatus) { 368 UserGestureStatus userGestureStatus) {
373 m_navigationScheduler->scheduleLocationChange( 369 m_navigationScheduler->scheduleLocationChange(
374 &originDocument, url.getString(), replaceCurrentItem); 370 &originDocument, url.getString(), replaceCurrentItem);
375 } 371 }
376 372
377 void LocalFrame::navigate(const FrameLoadRequest& request) { 373 void LocalFrame::navigate(const FrameLoadRequest& request) {
378 m_loader.load(request); 374 m_loader.load(request);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 484
489 domWindow()->printErrorMessage(message); 485 domWindow()->printErrorMessage(message);
490 } 486 }
491 487
492 void LocalFrame::printNavigationWarning(const String& message) { 488 void LocalFrame::printNavigationWarning(const String& message) {
493 m_console->addMessage( 489 m_console->addMessage(
494 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); 490 ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message));
495 } 491 }
496 492
497 WindowProxyManagerBase* LocalFrame::getWindowProxyManager() const { 493 WindowProxyManagerBase* LocalFrame::getWindowProxyManager() const {
498 return m_script->getWindowProxyManager(); 494 return m_script;
499 } 495 }
500 496
501 bool LocalFrame::shouldClose() { 497 bool LocalFrame::shouldClose() {
502 // TODO(dcheng): This should be fixed to dispatch beforeunload events to 498 // TODO(dcheng): This should be fixed to dispatch beforeunload events to
503 // both local and remote frames. 499 // both local and remote frames.
504 return m_loader.shouldClose(); 500 return m_loader.shouldClose();
505 } 501 }
506 502
507 void LocalFrame::detachChildren() { 503 void LocalFrame::detachChildren() {
508 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document()); 504 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
509 505
510 if (Document* document = this->document()) 506 if (Document* document = this->document())
511 ChildFrameDisconnector(*document).disconnect(); 507 ChildFrameDisconnector(*document).disconnect();
512 } 508 }
513 509
514 void LocalFrame::documentAttached() { 510 void LocalFrame::documentAttached() {
515 DCHECK(document()); 511 DCHECK(document());
516 selection().documentAttached(document()); 512 selection().documentAttached(document());
517 inputMethodController().documentAttached(document()); 513 inputMethodController().documentAttached(document());
518 } 514 }
519 515
520 LocalDOMWindow* LocalFrame::domWindow() const { 516 LocalDOMWindow* LocalFrame::domWindow() const {
521 return toLocalDOMWindow(m_domWindow); 517 return toLocalDOMWindow(m_domWindow);
522 } 518 }
523 519
524 void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) { 520 void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) {
525 if (domWindow) 521 if (domWindow)
526 script().clearWindowProxy(); 522 script().clearForNavigation();
527 523
528 if (this->domWindow()) 524 if (this->domWindow())
529 this->domWindow()->reset(); 525 this->domWindow()->reset();
530 m_domWindow = domWindow; 526 m_domWindow = domWindow;
531 } 527 }
532 528
533 Document* LocalFrame::document() const { 529 Document* LocalFrame::document() const {
534 return m_domWindow ? m_domWindow->document() : nullptr; 530 return m_domWindow ? m_domWindow->document() : nullptr;
535 } 531 }
536 532
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 inline LocalFrame::LocalFrame(FrameLoaderClient* client, 873 inline LocalFrame::LocalFrame(FrameLoaderClient* client,
878 FrameHost* host, 874 FrameHost* host,
879 FrameOwner* owner, 875 FrameOwner* owner,
880 InterfaceProvider* interfaceProvider, 876 InterfaceProvider* interfaceProvider,
881 InterfaceRegistry* interfaceRegistry) 877 InterfaceRegistry* interfaceRegistry)
882 : Frame(client, host, owner), 878 : Frame(client, host, owner),
883 m_frameScheduler(page()->chromeClient().createFrameScheduler( 879 m_frameScheduler(page()->chromeClient().createFrameScheduler(
884 client->frameBlameContext())), 880 client->frameBlameContext())),
885 m_loader(this), 881 m_loader(this),
886 m_navigationScheduler(NavigationScheduler::create(this)), 882 m_navigationScheduler(NavigationScheduler::create(this)),
887 m_script(ScriptController::create(this)), 883 m_script(ScriptController::create(*this)),
888 m_editor(Editor::create(*this)), 884 m_editor(Editor::create(*this)),
889 m_spellChecker(SpellChecker::create(*this)), 885 m_spellChecker(SpellChecker::create(*this)),
890 m_selection(FrameSelection::create(*this)), 886 m_selection(FrameSelection::create(*this)),
891 m_eventHandler(new EventHandler(*this)), 887 m_eventHandler(new EventHandler(*this)),
892 m_console(FrameConsole::create(*this)), 888 m_console(FrameConsole::create(*this)),
893 m_inputMethodController(InputMethodController::create(*this)), 889 m_inputMethodController(InputMethodController::create(*this)),
894 m_idleSpellCheckCallback(IdleSpellCheckCallback::create(*this)), 890 m_idleSpellCheckCallback(IdleSpellCheckCallback::create(*this)),
895 m_navigationDisableCount(0), 891 m_navigationDisableCount(0),
896 m_pageZoomFactor(parentPageZoomFactor(this)), 892 m_pageZoomFactor(parentPageZoomFactor(this)),
897 m_textZoomFactor(parentTextZoomFactor(this)), 893 m_textZoomFactor(parentTextZoomFactor(this)),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 939 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
944 m_frame->client()->frameBlameContext()->Enter(); 940 m_frame->client()->frameBlameContext()->Enter();
945 } 941 }
946 942
947 ScopedFrameBlamer::~ScopedFrameBlamer() { 943 ScopedFrameBlamer::~ScopedFrameBlamer() {
948 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 944 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
949 m_frame->client()->frameBlameContext()->Leave(); 945 m_frame->client()->frameBlameContext()->Leave();
950 } 946 }
951 947
952 } // namespace blink 948 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/RemoteFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698