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

Unified Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2575343002: Move logic of WebLocalFrameImpl::replaceSelection to Editor (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index a8b6dff32a558c7aafaad334ddc44055a9839081..82343babbefba12d7a2245e2b570827981e58a4c 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1665,6 +1665,14 @@ void Editor::tidyUpHTMLStructure(Document& document) {
// TODO(tkent): Should we check and move Text node children of <html>?
}
+void Editor::replaceSelection(const String& text) {
+ DCHECK(!frame().document()->needsLayoutTreeUpdate());
+ bool selectReplacement = behavior().shouldSelectReplacement();
+ bool smartReplace = true;
+ replaceSelectionWithText(text, selectReplacement, smartReplace,
+ InputEvent::InputType::InsertReplacementText);
+}
+
DEFINE_TRACE(Editor) {
visitor->trace(m_frame);
visitor->trace(m_lastEditCommand);
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.h ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698