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

Unified Diff: third_party/WebKit/public/web/WebInputMethodController.h

Issue 2508363003: [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (Closed)
Patch Set: 'controller' may be nullptr. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/web/WebInputMethodController.h
diff --git a/third_party/WebKit/public/web/WebInputMethodController.h b/third_party/WebKit/public/web/WebInputMethodController.h
index a4c6d832175d6dacd030f4bbb0e4b5bfe60f3529..001b28cae538a052efb39eb1b179330878a6259a 100644
--- a/third_party/WebKit/public/web/WebInputMethodController.h
+++ b/third_party/WebKit/public/web/WebInputMethodController.h
@@ -5,7 +5,9 @@
#ifndef WebInputMethodController_h
#define WebInputMethodController_h
+#include "../platform/WebTextInputInfo.h"
#include "WebCompositionUnderline.h"
+#include "WebTextInputType.h"
#include "WebWidget.h"
namespace blink {
@@ -33,14 +35,23 @@ class WebInputMethodController {
int selectionStart,
int selectionEnd) = 0;
- // Called to inform the WebWidget that deleting the ongoing composition if
+ // Called to inform the controller that deleting the ongoing composition if
// any, inserting the specified text, and moving the caret according to
// relativeCaretPosition.
virtual bool commitText(const WebString& text, int relativeCaretPosition) = 0;
- // Called to inform the WebWidget to confirm an ongoing composition.
+ // Called to inform the controller to confirm an ongoing composition.
virtual bool finishComposingText(
ConfirmCompositionBehavior selectionBehavior) = 0;
+
+ // Returns information about the current text input of this controller. Note
+ // that this query can be expensive for long fields, as it returns the
+ // plain-text representation of the current editable element. Consider using
+ // the lighter-weight textInputType() when appropriate.
+ virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); }
+
+ // Returns the type of current text input of this controller.
+ virtual WebTextInputType textInputType() { return WebTextInputTypeNone; }
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698