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

Unified Diff: mojo/services/view_manager/public/cpp/lib/view.cc

Issue 880743002: Plumb ViewportMetrics change notifications around the world and back. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: mojo/services/view_manager/public/cpp/lib/view.cc
diff --git a/mojo/services/view_manager/public/cpp/lib/view.cc b/mojo/services/view_manager/public/cpp/lib/view.cc
index c07edebd2f9e05a8ba746d76124043126b2995de..02f61a1d6109ed7d1ec5cf6a8b97c072019c8e2a 100644
--- a/mojo/services/view_manager/public/cpp/lib/view.cc
+++ b/mojo/services/view_manager/public/cpp/lib/view.cc
@@ -489,6 +489,17 @@ void View::LocalSetBounds(const Rect& old_bounds,
bounds_ = new_bounds;
}
+void View::LocalSetViewportMetrics(const ViewportMetrics& old_metrics,
sky 2015/01/27 16:35:08 Why does this need to take old_metrics? Isn't old_
eseidel 2015/01/27 18:50:04 I just tried to make it match what LocalSetBounds
+ const ViewportMetrics& new_metrics) {
+ DCHECK(viewport_metrics_->size == viewport_metrics_->size);
sky 2015/01/27 16:35:08 I think there is a bug where viewport_metrics_ is
eseidel 2015/01/27 18:50:04 Yes, there is. It's fixed a little in this patch,
+ DCHECK(viewport_metrics_->device_pixel_ratio ==
+ viewport_metrics_->device_pixel_ratio);
+ viewport_metrics_ = new_metrics.Clone();
+ FOR_EACH_OBSERVER(
+ ViewObserver, observers_,
+ OnViewViewportMetricsChanged(this, old_metrics, new_metrics));
+}
+
void View::LocalSetDrawn(bool value) {
if (drawn_ == value)
return;

Powered by Google App Engine
This is Rietveld 408576698