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

Side by Side Diff: Source/core/editing/SpellChecker.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool SpellChecker::isContinuousSpellCheckingEnabled() const 96 bool SpellChecker::isContinuousSpellCheckingEnabled() const
97 { 97 {
98 return spellCheckerClient().isContinuousSpellCheckingEnabled(); 98 return spellCheckerClient().isContinuousSpellCheckingEnabled();
99 } 99 }
100 100
101 void SpellChecker::toggleContinuousSpellChecking() 101 void SpellChecker::toggleContinuousSpellChecking()
102 { 102 {
103 spellCheckerClient().toggleContinuousSpellChecking(); 103 spellCheckerClient().toggleContinuousSpellChecking();
104 if (isContinuousSpellCheckingEnabled()) 104 if (isContinuousSpellCheckingEnabled())
105 return; 105 return;
106 for (LocalFrame* frame = m_frame.page()->mainFrame(); frame && frame->docume nt(); frame = frame->tree().traverseNext()) { 106 for (Frame* frame = m_frame.page()->mainFrame(); frame; frame = frame->tree( ).traverseNext()) {
107 for (Node* node = &frame->document()->rootNode(); node; node = NodeTrave rsal::next(*node)) { 107 if (!frame->isLocalFrame())
108 continue;
109 for (Node* node = &toLocalFrame(frame)->document()->rootNode(); node; no de = NodeTraversal::next(*node)) {
108 node->setAlreadySpellChecked(false); 110 node->setAlreadySpellChecked(false);
109 } 111 }
110 } 112 }
111 } 113 }
112 114
113 bool SpellChecker::isGrammarCheckingEnabled() 115 bool SpellChecker::isGrammarCheckingEnabled()
114 { 116 {
115 return spellCheckerClient().isGrammarCheckingEnabled(); 117 return spellCheckerClient().isGrammarCheckingEnabled();
116 } 118 }
117 119
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 } 847 }
846 848
847 void SpellChecker::requestTextChecking(const Element& element) 849 void SpellChecker::requestTextChecking(const Element& element)
848 { 850 {
849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element)); 851 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element));
850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck)); 852 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck));
851 } 853 }
852 854
853 855
854 } // namespace WebCore 856 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698