Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index 2f0322f30311b79dae940d09a35013bce3206172..99acd4af35687d97ca043a717e3cd2c3ff007372 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -1539,14 +1539,10 @@ void ContentViewCoreImpl::OnTextSurroundingSelectionResponse( |
const base::string16& content, |
int start_offset, |
int end_offset) { |
- JNIEnv* env = AttachCurrentThread(); |
- ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
- if (obj.is_null()) |
- return; |
- |
- ScopedJavaLocalRef<jstring> jcontent = ConvertUTF16ToJavaString(env, content); |
- Java_ContentViewCore_onTextSurroundingSelectionResponse( |
- env, obj.obj(), jcontent.obj(), start_offset, end_offset); |
+ if (text_surroundings_delegate_ != NULL) { |
+ text_surroundings_delegate_->OnTextSurroundingSelectionResponse( |
+ content, start_offset, end_offset); |
+ } |
} |
void ContentViewCoreImpl::SendOrientationChangeEventInternal() { |
@@ -1615,8 +1611,7 @@ void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, jobject jobj, |
GetRenderWidgetHostViewAndroid()->SetBackgroundOpaque(opaque); |
} |
-void ContentViewCoreImpl::TextSurroundingSelectionRequest( |
- JNIEnv*, jobject, jint max_length) { |
+void ContentViewCoreImpl::TextSurroundingSelectionRequest(int max_length) { |
RenderFrameHost* focused_frame = web_contents_->GetFocusedFrame(); |
focused_frame->Send(new FrameMsg_TextSurroundingSelectionRequest( |