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

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

Issue 2258663003: [InputEvent] Support |deleteByCut|&|insertFromPaste| with |dataTransfer| field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yosin's review2, fix nits 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
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 markMisspellingsAfterTypingCommand(toTypingCommand(cmd)); 331 markMisspellingsAfterTypingCommand(toTypingCommand(cmd));
332 return; 332 return;
333 } 333 }
334 334
335 if (!cmd.isReplaceSelectionCommand()) 335 if (!cmd.isReplaceSelectionCommand())
336 return; 336 return;
337 337
338 // Note: Request spell checking for and only for |ReplaceSelectionCommand|s 338 // Note: Request spell checking for and only for |ReplaceSelectionCommand|s
339 // created in |Editor::replaceSelectionWithFragment()|. 339 // created in |Editor::replaceSelectionWithFragment()|.
340 // TODO(xiaochengh): May also need to do this after dragging crbug.com/29804 6. 340 // TODO(xiaochengh): May also need to do this after dragging crbug.com/29804 6.
341 if (cmd.inputType() != InputEvent::InputType::Paste) 341 if (cmd.inputType() != InputEvent::InputType::InsertFromPaste)
342 return; 342 return;
343 343
344 markMisspellingsAfterReplaceSelectionCommand(toReplaceSelectionCommand(cmd)) ; 344 markMisspellingsAfterReplaceSelectionCommand(toReplaceSelectionCommand(cmd)) ;
345 } 345 }
346 346
347 void SpellChecker::markMisspellingsAfterTypingCommand(const TypingCommand& cmd) 347 void SpellChecker::markMisspellingsAfterTypingCommand(const TypingCommand& cmd)
348 { 348 {
349 m_spellCheckRequester->cancelCheck(); 349 m_spellCheckRequester->cancelCheck();
350 350
351 // Take a look at the selection that results after typing and determine whet her we need to spellcheck. 351 // Take a look at the selection that results after typing and determine whet her we need to spellcheck.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 VisiblePosition newParagraphStart = startOfNextParagraph(createVisiblePo sition(paragraphEnd)); 948 VisiblePosition newParagraphStart = startOfNextParagraph(createVisiblePo sition(paragraphEnd));
949 paragraphStart = newParagraphStart.toParentAnchoredPosition(); 949 paragraphStart = newParagraphStart.toParentAnchoredPosition();
950 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPositio n(); 950 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPositio n();
951 firstIteration = false; 951 firstIteration = false;
952 totalLengthProcessed += currentLength; 952 totalLengthProcessed += currentLength;
953 } 953 }
954 return std::make_pair(firstFoundItem, firstFoundOffset); 954 return std::make_pair(firstFoundItem, firstFoundOffset);
955 } 955 }
956 956
957 } // namespace blink 957 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp ('k') | third_party/WebKit/Source/core/events/InputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698