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

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

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Suppress superfluous non-user initiated text selection events Created 3 years, 6 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.cc
diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc
index 17d1ccaf6a973d21cd1b9bcbf9d3829afe729759..2701a5bd2446ee19163f497e68f749b2e30ae350 100644
--- a/content/public/test/text_input_test_utils.cc
+++ b/content/public/test/text_input_test_utils.cc
@@ -391,6 +391,21 @@ bool TextInputManagerTester::GetLastCompositionRangeLength(uint32_t* length) {
return true;
}
+bool TextInputManagerTester::GetTextSelectionUserInitiatedForView(
+ RenderWidgetHostView* view,
+ bool* user_initiated) {
+ TextInputManager* manager = observer_->text_input_manager();
+ DCHECK(manager);
+
+ RenderWidgetHostViewBase* view_base =
+ static_cast<RenderWidgetHostViewBase*>(view);
+ if (!manager->IsRegistered(view_base))
+ return false;
+
+ *user_initiated = manager->GetTextSelection(view_base)->user_initiated();
+ return true;
+}
+
bool TextInputManagerTester::IsTextInputStateChanged() {
return observer_->text_input_state_changed();
}

Powered by Google App Engine
This is Rietveld 408576698