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

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2289593007: Cleanup call relationship in SpellChecker (Closed)
Patch Set: Cleanup call relationship in SpellChecker Created 4 years, 3 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 | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | no next file » | 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 { 301 {
302 if (spellCheckerClient().spellingUIIsShowing()) { 302 if (spellCheckerClient().spellingUIIsShowing()) {
303 spellCheckerClient().showSpellingUI(false); 303 spellCheckerClient().showSpellingUI(false);
304 return; 304 return;
305 } 305 }
306 306
307 advanceToNextMisspelling(true); 307 advanceToNextMisspelling(true);
308 spellCheckerClient().showSpellingUI(true); 308 spellCheckerClient().showSpellingUI(true);
309 } 309 }
310 310
311 void SpellChecker::clearMisspellingsAndBadGrammar(const VisibleSelection &moving Selection) 311 void SpellChecker::clearMisspellingsAndBadGrammarForMovingParagraphs(const Visib leSelection& movingSelection)
312 { 312 {
313 removeMarkers(movingSelection, DocumentMarker::MisspellingMarkers()); 313 removeMarkers(movingSelection, DocumentMarker::MisspellingMarkers());
314 } 314 }
315 315
316 void SpellChecker::markMisspellingsAndBadGrammarForMovingParagraphs(const Visibl eSelection& movingSelection)
317 {
318 markMisspellingsAndBadGrammar(movingSelection);
319 }
320
316 void SpellChecker::markMisspellingsAndBadGrammar(const VisibleSelection& selecti on) 321 void SpellChecker::markMisspellingsAndBadGrammar(const VisibleSelection& selecti on)
317 { 322 {
318 if (!isSpellCheckingEnabled() || !isSpellCheckingEnabledFor(selection)) 323 if (!isSpellCheckingEnabled() || !isSpellCheckingEnabledFor(selection))
319 return; 324 return;
320 325
321 const EphemeralRange& range = selection.toNormalizedEphemeralRange(); 326 const EphemeralRange& range = selection.toNormalizedEphemeralRange();
322 if (range.isNull()) 327 if (range.isNull())
323 return; 328 return;
324 329
325 // If we're not in an editable node, bail. 330 // If we're not in an editable node, bail.
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 VisiblePosition newParagraphStart = startOfNextParagraph(createVisiblePo sition(paragraphEnd)); 948 VisiblePosition newParagraphStart = startOfNextParagraph(createVisiblePo sition(paragraphEnd));
944 paragraphStart = newParagraphStart.toParentAnchoredPosition(); 949 paragraphStart = newParagraphStart.toParentAnchoredPosition();
945 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPositio n(); 950 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPositio n();
946 firstIteration = false; 951 firstIteration = false;
947 totalLengthProcessed += currentLength; 952 totalLengthProcessed += currentLength;
948 } 953 }
949 return std::make_pair(firstFoundItem, firstFoundOffset); 954 return std::make_pair(firstFoundItem, firstFoundOffset);
950 } 955 }
951 956
952 } // namespace blink 957 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698