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

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

Issue 72543005: Get rid of explict editor dependency from text field (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-11-15T16:10:10 Created 7 years, 1 month 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 | Annotate | Revision Log
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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 RefPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperti es(); 1190 RefPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperti es();
1191 if (!blockStyle->isEmpty()) { 1191 if (!blockStyle->isEmpty()) {
1192 ASSERT(m_frame.document()); 1192 ASSERT(m_frame.document());
1193 ApplyStyleCommand::create(*m_frame.document(), blockStyle.get(), editing Action)->apply(); 1193 ApplyStyleCommand::create(*m_frame.document(), blockStyle.get(), editing Action)->apply();
1194 } 1194 }
1195 1195
1196 // Set the remaining style as the typing style. 1196 // Set the remaining style as the typing style.
1197 m_frame.selection().setTypingStyle(typingStyle); 1197 m_frame.selection().setTypingStyle(typingStyle);
1198 } 1198 }
1199 1199
1200 void Editor::textAreaOrTextFieldDidBeginEditing(Element* e)
1201 {
1202 spellChecker().didBeginEditing(e);
1203 }
1204
1205 void Editor::textFieldDidEndEditing(Element* e)
1206 {
1207 spellChecker().didEndEditingOnTextField(e);
1208 client().textFieldDidEndEditing(e);
1209 }
1210
1211 void Editor::textDidChangeInTextField(Element* e)
1212 {
1213 client().textDidChangeInTextField(e);
1214 }
1215
1216 bool Editor::doTextFieldCommandFromEvent(Element* e, KeyboardEvent* ke)
1217 {
1218 return client().doTextFieldCommandFromEvent(e, ke);
1219 }
1220
1221 bool Editor::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection) 1200 bool Editor::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection)
1222 { 1201 {
1223 FindOptions options = (forward ? 0 : Backwards) | (caseFlag ? 0 : CaseInsens itive) | (wrapFlag ? WrapAround : 0) | (startInSelection ? StartInSelection : 0) ; 1202 FindOptions options = (forward ? 0 : Backwards) | (caseFlag ? 0 : CaseInsens itive) | (wrapFlag ? WrapAround : 0) | (startInSelection ? StartInSelection : 0) ;
1224 return findString(target, options); 1203 return findString(target, options);
1225 } 1204 }
1226 1205
1227 bool Editor::findString(const String& target, FindOptions options) 1206 bool Editor::findString(const String& target, FindOptions options)
1228 { 1207 {
1229 VisibleSelection selection = m_frame.selection().selection(); 1208 VisibleSelection selection = m_frame.selection().selection();
1230 1209
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 return spellChecker().isContinuousSpellCheckingEnabled(); 1326 return spellChecker().isContinuousSpellCheckingEnabled();
1348 } 1327 }
1349 1328
1350 void Editor::toggleOverwriteModeEnabled() 1329 void Editor::toggleOverwriteModeEnabled()
1351 { 1330 {
1352 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1331 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1353 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1332 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1354 } 1333 }
1355 1334
1356 } // namespace WebCore 1335 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698