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

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

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (Closed)
Patch Set: Created 4 years 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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 if (currentDocument != frame().document()) 838 if (currentDocument != frame().document())
839 return; 839 return;
840 840
841 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 841 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
842 // needs to be audited. See http://crbug.com/590369 for more details. 842 // needs to be audited. See http://crbug.com/590369 for more details.
843 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); 843 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
844 844
845 if (cancel) 845 if (cancel)
846 return; 846 return;
847 frame().editor().replaceSelectionWithText( 847 frame().editor().replaceSelectionWithText(
848 text, false, false, InputEvent::InputType::InsertReplacementText); 848 CommandSource::MenuOrKeyBinding, text, false, false,
849 InputEvent::InputType::InsertReplacementText);
849 } 850 }
850 851
851 static bool shouldCheckOldSelection(const Position& oldSelectionStart) { 852 static bool shouldCheckOldSelection(const Position& oldSelectionStart) {
852 if (!oldSelectionStart.isConnected()) 853 if (!oldSelectionStart.isConnected())
853 return false; 854 return false;
854 if (isPositionInTextField(oldSelectionStart)) 855 if (isPositionInTextField(oldSelectionStart))
855 return false; 856 return false;
856 if (isPositionInTextArea(oldSelectionStart)) 857 if (isPositionInTextArea(oldSelectionStart))
857 return true; 858 return true;
858 859
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 startOfNextParagraph(createVisiblePosition(paragraphEnd)); 1155 startOfNextParagraph(createVisiblePosition(paragraphEnd));
1155 paragraphStart = newParagraphStart.toParentAnchoredPosition(); 1156 paragraphStart = newParagraphStart.toParentAnchoredPosition();
1156 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); 1157 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition();
1157 firstIteration = false; 1158 firstIteration = false;
1158 totalLengthProcessed += currentLength; 1159 totalLengthProcessed += currentLength;
1159 } 1160 }
1160 return std::make_pair(firstFoundItem, firstFoundOffset); 1161 return std::make_pair(firstFoundItem, firstFoundOffset);
1161 } 1162 }
1162 1163
1163 } // namespace blink 1164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698