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

Unified Diff: sky/shell/ui/engine.cc

Issue 880443003: Plumb resize notifications around sky/shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: git cl format Created 5 years, 10 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: sky/shell/ui/engine.cc
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc
index ed1971d3677d276578b3fe96b13c714a2f1bc761..07deb847c24e59da3022b478b6b4f12c87ab4044 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -32,5 +32,13 @@ void Engine::Init() {
web_view_->setMainFrame(blink::WebLocalFrame::create(this));
}
+void Engine::OnViewportMetricsChanged(const gfx::Size& size,
+ float device_pixel_ratio) {
+ blink::WebSize web_size(size.width() / device_pixel_ratio,
+ size.height() / device_pixel_ratio);
+ web_view_->setDeviceScaleFactor(device_pixel_ratio);
+ web_view_->resize(web_size);
+}
+
} // namespace shell
} // namespace sky
« sky/shell/sky_view.cc ('K') | « sky/shell/ui/engine.h ('k') | sky/shell/ui_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698