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

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

Issue 2841033002: Avoid repeating frame info calculation in Java layer (Closed)
Patch Set: Created 3 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 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 f79636db8f4ea8c4b370091484c3ce0fa47be532..5a2bbce24a2aa388e63d0df5e7f3af63ef6afd71 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -407,16 +407,16 @@ void ContentViewCoreImpl::UpdateFrameInfo(
const gfx::Vector2dF& page_scale_factor_limits,
const gfx::SizeF& content_size,
const gfx::SizeF& viewport_size,
- const float top_controls_height,
- const float top_controls_shown_ratio,
+ const float content_offset,
+ const float top_shown_pix,
+ bool top_changed,
bool is_mobile_optimized_hint) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null() || !GetWindowAndroid())
return;
- GetViewAndroid()->set_content_offset(
- gfx::Vector2dF(0.0f, top_controls_height * top_controls_shown_ratio));
+ GetViewAndroid()->set_content_offset(gfx::Vector2dF(0.0f, content_offset));
page_scale_ = page_scale_factor;
@@ -424,7 +424,7 @@ void ContentViewCoreImpl::UpdateFrameInfo(
env, obj, scroll_offset.x(), scroll_offset.y(), page_scale_factor,
page_scale_factor_limits.x(), page_scale_factor_limits.y(),
content_size.width(), content_size.height(), viewport_size.width(),
- viewport_size.height(), top_controls_height, top_controls_shown_ratio,
+ viewport_size.height(), top_shown_pix, top_changed,
is_mobile_optimized_hint);
}

Powered by Google App Engine
This is Rietveld 408576698