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

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

Issue 1907703002: Fix a nasty scroll bug for Chrome Now-on-tap feature. Also combine the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix findbug issue (remove unused variable) Created 4 years, 8 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 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) { 1481 void ContentViewCoreImpl::OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip) {
1482 JNIEnv* env = AttachCurrentThread(); 1482 JNIEnv* env = AttachCurrentThread();
1483 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1483 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1484 if (obj.is_null()) 1484 if (obj.is_null())
1485 return; 1485 return;
1486 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded( 1486 Java_ContentViewCore_onShowUnhandledTapUIIfNeeded(
1487 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), 1487 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()),
1488 static_cast<jint>(y_dip * dpi_scale())); 1488 static_cast<jint>(y_dip * dpi_scale()));
1489 } 1489 }
1490 1490
1491 float ContentViewCoreImpl::GetScaleFactor() const {
1492 return page_scale_ * dpi_scale_;
1493 }
1494
1495 void ContentViewCoreImpl::OnSmartClipDataExtracted( 1491 void ContentViewCoreImpl::OnSmartClipDataExtracted(
1496 const base::string16& text, 1492 const base::string16& text,
1497 const base::string16& html, 1493 const base::string16& html,
1498 const gfx::Rect& clip_rect) { 1494 const gfx::Rect& clip_rect) {
1499 JNIEnv* env = AttachCurrentThread(); 1495 JNIEnv* env = AttachCurrentThread();
1500 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1496 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1501 if (obj.is_null()) 1497 if (obj.is_null())
1502 return; 1498 return;
1503 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); 1499 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text);
1504 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); 1500 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 return ScopedJavaLocalRef<jobject>(); 1569 return ScopedJavaLocalRef<jobject>();
1574 1570
1575 return view->GetJavaObject(); 1571 return view->GetJavaObject();
1576 } 1572 }
1577 1573
1578 bool RegisterContentViewCore(JNIEnv* env) { 1574 bool RegisterContentViewCore(JNIEnv* env) {
1579 return RegisterNativesImpl(env); 1575 return RegisterNativesImpl(env);
1580 } 1576 }
1581 1577
1582 } // namespace content 1578 } // 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