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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 1923613002: Fix a nasty scroll bug for Chrome Now-on-tap feature. Also combine the code paths for Android Webvi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { 1483 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) {
1484 JNIEnv* env = AttachCurrentThread(); 1484 JNIEnv* env = AttachCurrentThread();
1485 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1485 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1486 if (obj.is_null()) 1486 if (obj.is_null())
1487 return; 1487 return;
1488 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( 1488 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded(
1489 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), 1489 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()),
1490 static_cast<jint>(y_dip * dpi_scale())); 1490 static_cast<jint>(y_dip * dpi_scale()));
1491 } 1491 }
1492 1492
1493 float ContentViewCoreImpl::GetScaleFactor() const {
1494 return page_scale_ * dpi_scale_;
1495 }
1496
1497 void ContentViewCoreImpl::OnSmartClipDataExtracted( 1493 void ContentViewCoreImpl::OnSmartClipDataExtracted(
1498 const base::string16& text, 1494 const base::string16& text,
1499 const base::string16& html, 1495 const base::string16& html,
1500 const gfx::Rect& clip_rect) { 1496 const gfx::Rect& clip_rect) {
1501 JNIEnv* env = AttachCurrentThread(); 1497 JNIEnv* env = AttachCurrentThread();
1502 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1498 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1503 if (obj.is_null()) 1499 if (obj.is_null())
1504 return; 1500 return;
1505 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); 1501 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text);
1506 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); 1502 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 return ScopedJavaLocalRef<jobject>(); 1571 return ScopedJavaLocalRef<jobject>();
1576 1572
1577 return view->GetJavaObject(); 1573 return view->GetJavaObject();
1578 } 1574 }
1579 1575
1580 bool RegisterContentViewCore(JNIEnv* env) { 1576 bool RegisterContentViewCore(JNIEnv* env) {
1581 return RegisterNativesImpl(env); 1577 return RegisterNativesImpl(env);
1582 } 1578 }
1583 1579
1584 } // namespace content 1580 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/web_contents/web_contents_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698