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

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

Issue 1165003006: Various fixes in preparation for deploying (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove game changes Created 5 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
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/ui/engine.cc
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc
index 5a0d62b7503a4c88de5f3ac6ea313888f859cc07..63fd90874a53da6560a0612b16eca022ef4e05bc 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -127,17 +127,22 @@ void Engine::OnViewportMetricsChanged(int width, int height,
physical_size_.SetSize(width, height);
device_pixel_ratio_ = device_pixel_ratio;
- if (sky_view_) {
- blink::SkyDisplayMetrics metrics;
- metrics.physical_size = physical_size_;
- metrics.device_pixel_ratio = device_pixel_ratio_;
- sky_view_->SetDisplayMetrics(metrics);
- }
+ if (sky_view_)
+ UpdateSkyViewSize();
if (web_view_)
UpdateWebViewSize();
}
+void Engine::UpdateSkyViewSize()
+{
abarth-chromium 2015/06/04 23:46:42 These two lines should be merged.
+ CHECK(sky_view_);
+ blink::SkyDisplayMetrics metrics;
+ metrics.physical_size = physical_size_;
+ metrics.device_pixel_ratio = device_pixel_ratio_;
+ sky_view_->SetDisplayMetrics(metrics);
+}
+
void Engine::UpdateWebViewSize()
{
CHECK(web_view_);
@@ -172,8 +177,13 @@ void Engine::OnInputEvent(InputEventPtr event) {
void Engine::LoadURL(const mojo::String& mojo_url) {
GURL url(mojo_url);
if (!blink::WebView::shouldUseWebView(url)) {
+ if (web_view_) {
+ web_view_->close();
+ web_view_ = nullptr;
+ }
sky_view_ = blink::SkyView::Create(this);
sky_view_->Load(url);
+ UpdateSkyViewSize();
return;
}
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698