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

Unified Diff: ui/android/view_android.cc

Issue 2842693005: Store physical backing size in ViewAndroid (Closed)
Patch Set: no UpdateLayerBounds Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/android/view_android.cc
diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc
index 15e51a0042ca48b6eb5c29d0bbbc6cafdb9541a3..f7bfb0f32df54d0b0e6bf7f4f3e6c6af9bb31be4 100644
--- a/ui/android/view_android.cc
+++ b/ui/android/view_android.cc
@@ -123,6 +123,7 @@ void ViewAndroid::AddChild(ViewAndroid* child) {
if (child->parent_)
child->RemoveFromParent();
child->parent_ = this;
+ child->OnPhysicalBackingSizeChanged(physical_size_);
}
// static
@@ -279,6 +280,20 @@ int ViewAndroid::GetSystemWindowInsetBottom() {
return Java_ViewAndroidDelegate_getSystemWindowInsetBottom(env, delegate);
}
+void ViewAndroid::OnPhysicalBackingSizeChanged(const gfx::Size& size) {
+ if (physical_size_ == size)
+ return;
+ physical_size_ = size;
+ client_->OnPhysicalBackingSizeChanged();
+
+ for (auto* child : children_)
+ child->OnPhysicalBackingSizeChanged(size);
+}
+
+gfx::Size ViewAndroid::GetPhysicalBackingSize() {
+ return physical_size_;
+}
+
bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event,
bool for_touch_handle) {
return HitTest(

Powered by Google App Engine
This is Rietveld 408576698