summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_widget_host_view_android.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/renderer_host/render_widget_host_view_android.cc')
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 120161d..f421735 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -433,10 +433,21 @@ void RenderWidgetHostViewAndroid::UnlockCompositingSurface() {
}
}
+void RenderWidgetHostViewAndroid::SetTextSurroundingSelectionCallback(
+ const TextSurroundingSelectionCallback& callback) {
+ // Only one outstanding request is allowed at any given time.
+ DCHECK(!callback.is_null());
+ text_surrounding_selection_callback_ = callback;
+}
+
void RenderWidgetHostViewAndroid::OnTextSurroundingSelectionResponse(
const base::string16& content,
size_t start_offset,
size_t end_offset) {
+ if (text_surrounding_selection_callback_.is_null())
+ return;
+ text_surrounding_selection_callback_.Run(content, start_offset, end_offset);
+ text_surrounding_selection_callback_.Reset();
}
void RenderWidgetHostViewAndroid::ReleaseLocksOnSurface() {