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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.h

Issue 1999423002: tyrbot test for commitText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetHasCompositionTextToTrue 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/InputMethodController.h
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.h b/third_party/WebKit/Source/core/editing/InputMethodController.h
index 2a36cd448c04744b1a4cd951af5f87b778700fef..06ba0966575509adc27ab0251c9c15cec8ab600f 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.h
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.h
@@ -57,17 +57,20 @@ public:
bool hasComposition() const;
void setComposition(const String&, const Vector<CompositionUnderline>&, int selectionStart, int selectionEnd);
void setCompositionFromExistingText(const Vector<CompositionUnderline>&, unsigned compositionStart, unsigned compositionEnd);
- // Inserts the text that is being composed as a regular text and returns true
- // if composition exists.
- bool confirmComposition();
- // Inserts the given text string in the place of the existing composition
- // and returns true.
- bool confirmComposition(const String& text, ConfirmCompositionBehavior confirmBehavior = KeepSelection);
- // Inserts the text that is being composed or specified non-empty text and
- // returns true.
- bool confirmCompositionOrInsertText(const String& text, ConfirmCompositionBehavior);
+
+ // Deletes ongoing composing text if any, inserts specified text, and
+ // changes the selection according to relativeCaretPosition, which is
+ // relative to the end of the inserting text.
+ bool commitText(const String& text, int relativeCaretPosition);
+
+ // Inserts ongoing composing text; changes the selection to the end of
+ // the inserting text if DoNotKeepSelection, or holds the selection if
+ // KeepSelection.
+ bool finishComposingText(ConfirmCompositionBehavior);
+
// Deletes the existing composition text.
void cancelComposition();
+
void cancelCompositionIfSelectionIsInvalid();
EphemeralRange compositionEphemeralRange() const;
Range* compositionRange() const;
@@ -111,6 +114,19 @@ private:
String composingText() const;
void selectComposition() const;
bool setSelectionOffsets(const PlainTextRange&, FrameSelection::SetSelectionOptions = FrameSelection::CloseTyping);
+
+ bool insertText(const String&);
+ bool insertTextAndMoveCaret(const String&, int relativeCaretPosition);
+
+ // Inserts the given text string in the place of the existing composition.
+ // Returns true if did replace.
+ bool replaceComposition(const String& text);
+ // Inserts the given text string in the place of the existing composition
+ // and moves caret. Returns true if did replace and moved caret successfully.
+ bool replaceCompositionAndMoveCaret(const String&, int relativeCaretPosition);
+
+ // Returns true if moved caret successfully.
+ bool moveCaret(int newCaretPosition);
};
} // namespace blink
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698