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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 2667283007: Refactor Samsung SmartClip implementation. (Closed)
Patch Set: Move FrameMsg Created 3 years, 10 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/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 392db7b22efd445ef65ae90fb3b2a9caad6f73e2..9d97ff3572b0127984f56d8d72ea859e04d5adfc 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1403,23 +1403,6 @@ void ContentViewCoreImpl::SendOrientationChangeEventInternal() {
->OnOrientationChange();
}
-void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- jint x,
- jint y,
- jint width,
- jint height) {
- gfx::Rect rect(
- static_cast<int>(x / dpi_scale()),
- static_cast<int>(y / dpi_scale()),
- static_cast<int>((width > 0 && width < dpi_scale()) ?
- 1 : (int)(width / dpi_scale())),
boliu 2017/02/06 13:08:09 this code used to ensure width/height at least 1,
aelias_OOO_until_Jul13 2017/02/07 20:48:12 Right, I dropped it intentionally, seemed like unn
- static_cast<int>((height > 0 && height < dpi_scale()) ?
- 1 : (int)(height / dpi_scale())));
- GetWebContents()->Send(new ViewMsg_ExtractSmartClipData(
- GetWebContents()->GetRenderViewHost()->GetRoutingID(), rect));
-}
-
jint ContentViewCoreImpl::GetCurrentRenderProcessId(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
@@ -1525,21 +1508,6 @@ void ContentViewCoreImpl::HidePopupsAndPreserveSelection() {
Java_ContentViewCore_hidePopupsAndPreserveSelection(env, obj);
}
-void ContentViewCoreImpl::OnSmartClipDataExtracted(
- const base::string16& text,
- const base::string16& html,
- const gfx::Rect& clip_rect) {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
- if (obj.is_null())
- return;
- ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text);
- ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html);
- ScopedJavaLocalRef<jobject> clip_rect_object(CreateJavaRect(env, clip_rect));
- Java_ContentViewCore_onSmartClipDataExtracted(env, obj, jtext, jhtml,
- clip_rect_object);
-}
-
void ContentViewCoreImpl::WebContentsDestroyed() {
WebContentsViewAndroid* wcva = static_cast<WebContentsViewAndroid*>(
static_cast<WebContentsImpl*>(web_contents())->GetView());

Powered by Google App Engine
This is Rietveld 408576698