Index: content/browser/renderer_host/render_widget_host_view_android.cc |
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 120161d67e823db56a39e5bace562b2155e70849..f4217357c753379b26a0ac67d7a27ff0d0c22425 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() { |