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

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

Issue 2701983002: Implement complete lifecycle transition for IdleSpellCheckCallback (Closed)
Patch Set: Add lifecycle transition unit tests Created 3 years, 9 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document()); 509 DCHECK(m_loader.stateMachine()->creatingInitialEmptyDocument() || document());
510 510
511 if (Document* document = this->document()) 511 if (Document* document = this->document())
512 ChildFrameDisconnector(*document).disconnect(); 512 ChildFrameDisconnector(*document).disconnect();
513 } 513 }
514 514
515 void LocalFrame::documentAttached() { 515 void LocalFrame::documentAttached() {
516 DCHECK(document()); 516 DCHECK(document());
517 selection().documentAttached(document()); 517 selection().documentAttached(document());
518 inputMethodController().documentAttached(document()); 518 inputMethodController().documentAttached(document());
519 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
520 idleSpellCheckCallback().documentAttached(document());
519 } 521 }
520 522
521 LocalDOMWindow* LocalFrame::domWindow() const { 523 LocalDOMWindow* LocalFrame::domWindow() const {
522 return toLocalDOMWindow(m_domWindow); 524 return toLocalDOMWindow(m_domWindow);
523 } 525 }
524 526
525 void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) { 527 void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) {
526 if (domWindow) 528 if (domWindow)
527 script().clearWindowProxy(); 529 script().clearWindowProxy();
528 530
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 return static_cast<FrameLoaderClient*>(Frame::client()); 897 return static_cast<FrameLoaderClient*>(Frame::client());
896 } 898 }
897 899
898 PluginData* LocalFrame::pluginData() const { 900 PluginData* LocalFrame::pluginData() const {
899 if (!loader().allowPlugins(NotAboutToInstantiatePlugin)) 901 if (!loader().allowPlugins(NotAboutToInstantiatePlugin))
900 return nullptr; 902 return nullptr;
901 return page()->pluginData( 903 return page()->pluginData(
902 tree().top()->securityContext()->getSecurityOrigin()); 904 tree().top()->securityContext()->getSecurityOrigin());
903 } 905 }
904 906
907 void LocalFrame::setNeedsSpellChecking() {
908 if (!RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
909 return;
910 idleSpellCheckCallback().setNeedsInvocation();
911 }
912
905 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); 913 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame);
906 914
907 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) 915 FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame)
908 : m_frame(&frame) { 916 : m_frame(&frame) {
909 m_frame->disableNavigation(); 917 m_frame->disableNavigation();
910 } 918 }
911 919
912 FrameNavigationDisabler::~FrameNavigationDisabler() { 920 FrameNavigationDisabler::~FrameNavigationDisabler() {
913 m_frame->enableNavigation(); 921 m_frame->enableNavigation();
914 } 922 }
915 923
916 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) { 924 ScopedFrameBlamer::ScopedFrameBlamer(LocalFrame* frame) : m_frame(frame) {
917 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 925 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
918 m_frame->client()->frameBlameContext()->Enter(); 926 m_frame->client()->frameBlameContext()->Enter();
919 } 927 }
920 928
921 ScopedFrameBlamer::~ScopedFrameBlamer() { 929 ScopedFrameBlamer::~ScopedFrameBlamer() {
922 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 930 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
923 m_frame->client()->frameBlameContext()->Leave(); 931 m_frame->client()->frameBlameContext()->Leave();
924 } 932 }
925 933
926 } // namespace blink 934 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698