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

Unified Diff: content/public/test/text_input_test_utils.h

Issue 2130133004: Tracking text selection on the browser side in OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase added GetSelectedText() and its unit test back Created 4 years, 5 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
Index: content/public/test/text_input_test_utils.h
diff --git a/content/public/test/text_input_test_utils.h b/content/public/test/text_input_test_utils.h
index 97b1da1a76da600d20012d722a49a0c3db3c35b0..1f36862e9bfb36087b9e15f5243f1a3365529f06 100644
--- a/content/public/test/text_input_test_utils.h
+++ b/content/public/test/text_input_test_utils.h
@@ -78,6 +78,10 @@ class TextInputManagerTester {
// ImeCompositionRangeChanged on the TextInputManager that is being observed.
void SetOnImeCompositionRangeChangedCallback(const base::Closure& callback);
+ // Sets a callback which is invoked when a RWHV calls SelectionChanged on the
+ // TextInputManager which is being observed.
+ void SetOnTextSelectionChangedCallback(const base::Closure& callback);
+
// Returns true if there is a focused <input> and populates |type| with
// |TextInputState.type| of the TextInputManager.
bool GetTextInputType(ui::TextInputType* type);
@@ -86,6 +90,10 @@ class TextInputManagerTester {
// |TextInputState.value| of the TextInputManager.
bool GetTextInputValue(std::string* value);
+ // Returns true if there is a focused <input> and populates |length| with the
+ // length of the selected text range in the focused view.
+ bool GetCurrentTextSelectionLength(size_t* length);
+
EhsanK 2016/07/18 15:21:29 TextSelection could be for non-<input> but as far
// Returns the RenderWidgetHostView with a focused <input> element or nullptr
// if none exists.
const RenderWidgetHostView* GetActiveView();

Powered by Google App Engine
This is Rietveld 408576698