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

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

Issue 2856093003: Update TextSelection for non-user initiated events (Closed)
Patch Set: Created 3 years, 8 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 cbed2345122ed555231647ae60adcfa7fd1260e6..a14830a20dea8d0866d023db0974dc2ead863462 100644
--- a/content/public/test/text_input_test_utils.cc
+++ b/content/public/test/text_input_test_utils.cc
@@ -356,6 +356,21 @@ bool TextInputManagerTester::GetCurrentTextSelectionLength(size_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