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

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-18T17:22:32 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
« no previous file with comments | « Source/core/editing/Editor.h ('k') | Source/core/html/HTMLInputElement.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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 RefPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperti es(); 1194 RefPtr<EditingStyle> blockStyle = typingStyle->extractAndRemoveBlockProperti es();
1195 if (!blockStyle->isEmpty()) { 1195 if (!blockStyle->isEmpty()) {
1196 ASSERT(m_frame.document()); 1196 ASSERT(m_frame.document());
1197 ApplyStyleCommand::create(*m_frame.document(), blockStyle.get(), editing Action)->apply(); 1197 ApplyStyleCommand::create(*m_frame.document(), blockStyle.get(), editing Action)->apply();
1198 } 1198 }
1199 1199
1200 // Set the remaining style as the typing style. 1200 // Set the remaining style as the typing style.
1201 m_frame.selection().setTypingStyle(typingStyle); 1201 m_frame.selection().setTypingStyle(typingStyle);
1202 } 1202 }
1203 1203
1204 void Editor::textAreaOrTextFieldDidBeginEditing(Element* e)
1205 {
1206 spellChecker().didBeginEditing(e);
1207 }
1208
1209 void Editor::textFieldDidEndEditing(Element* e)
1210 {
1211 spellChecker().didEndEditingOnTextField(e);
1212 client().textFieldDidEndEditing(e);
1213 }
1214
1215 void Editor::textDidChangeInTextField(Element* e)
1216 {
1217 client().textDidChangeInTextField(e);
1218 }
1219
1220 bool Editor::doTextFieldCommandFromEvent(Element* e, KeyboardEvent* ke)
1221 {
1222 return client().doTextFieldCommandFromEvent(e, ke);
1223 }
1224
1225 bool Editor::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection) 1204 bool Editor::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection)
1226 { 1205 {
1227 FindOptions options = (forward ? 0 : Backwards) | (caseFlag ? 0 : CaseInsens itive) | (wrapFlag ? WrapAround : 0) | (startInSelection ? StartInSelection : 0) ; 1206 FindOptions options = (forward ? 0 : Backwards) | (caseFlag ? 0 : CaseInsens itive) | (wrapFlag ? WrapAround : 0) | (startInSelection ? StartInSelection : 0) ;
1228 return findString(target, options); 1207 return findString(target, options);
1229 } 1208 }
1230 1209
1231 bool Editor::findString(const String& target, FindOptions options) 1210 bool Editor::findString(const String& target, FindOptions options)
1232 { 1211 {
1233 VisibleSelection selection = m_frame.selection().selection(); 1212 VisibleSelection selection = m_frame.selection().selection();
1234 1213
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 return spellChecker().isContinuousSpellCheckingEnabled(); 1330 return spellChecker().isContinuousSpellCheckingEnabled();
1352 } 1331 }
1353 1332
1354 void Editor::toggleOverwriteModeEnabled() 1333 void Editor::toggleOverwriteModeEnabled()
1355 { 1334 {
1356 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1335 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1357 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1336 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1358 } 1337 }
1359 1338
1360 } // namespace WebCore 1339 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.h ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698