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

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

Issue 2106753004: Introduce bottom controls to CC and let it respond to scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 7d636b6f9cd372551f017f41d54572848b612c65..d04e4c235dff7985f15af762ccc45a23f45bf0a2 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -422,6 +422,8 @@ void ContentViewCoreImpl::UpdateFrameInfo(
const gfx::SizeF& viewport_size,
const gfx::Vector2dF& controls_offset,
const gfx::Vector2dF& content_offset,
+ const gfx::Vector2dF& bottom_controls_offset,
+ const gfx::Vector2dF& bottom_controls_translate,
bool is_mobile_optimized_hint,
const gfx::SelectionBound& selection_start) {
JNIEnv* env = AttachCurrentThread();
@@ -459,6 +461,8 @@ void ContentViewCoreImpl::UpdateFrameInfo(
viewport_size.height(),
controls_offset.y(),
content_offset.y(),
+ bottom_controls_offset.y(),
+ bottom_controls_translate.y(),
is_mobile_optimized_hint,
has_insertion_marker,
is_insertion_marker_visible,
@@ -779,7 +783,7 @@ gfx::Size ContentViewCoreImpl::GetViewSizeWithOSKHidden() const {
gfx::Size ContentViewCoreImpl::GetViewSize() const {
gfx::Size size = GetViewportSizeDip();
if (DoTopControlsShrinkBlinkSize())
- size.Enlarge(0, -GetTopControlsHeightDip());
+ size.Enlarge(0, -GetTopControlsHeightDip() - GetBottomControlsHeightDip());
return size;
}
@@ -811,6 +815,14 @@ int ContentViewCoreImpl::GetTopControlsHeightPix() const {
return Java_ContentViewCore_getTopControlsHeightPix(env, j_obj.obj());
}
+int ContentViewCoreImpl::GetBottomControlsHeightPix() const {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
+ if (j_obj.is_null())
+ return 0;
+ return Java_ContentViewCore_getBottomControlsHeightPix(env, j_obj.obj());
+}
+
gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const {
return gfx::ScaleToCeiledSize(GetViewportSizePix(), 1.0f / dpi_scale());
}
@@ -827,6 +839,10 @@ float ContentViewCoreImpl::GetTopControlsHeightDip() const {
return GetTopControlsHeightPix() / dpi_scale();
}
+float ContentViewCoreImpl::GetBottomControlsHeightDip() const {
+ return GetBottomControlsHeightPix() / dpi_scale();
+}
+
void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) {
root_layer_->InsertChild(layer, 0);
root_layer_->SetIsDrawable(false);

Powered by Google App Engine
This is Rietveld 408576698