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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/shell/ui/engine.h" 5 #include "sky/shell/ui/engine.h"
6 6
7 #include "sky/engine/public/web/Sky.h" 7 #include "sky/engine/public/web/Sky.h"
8 #include "sky/engine/public/web/WebLocalFrame.h" 8 #include "sky/engine/public/web/WebLocalFrame.h"
9 #include "sky/engine/public/web/WebView.h" 9 #include "sky/engine/public/web/WebView.h"
10 #include "sky/shell/ui/platform_impl.h" 10 #include "sky/shell/ui/platform_impl.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 void Engine::Init() { 27 void Engine::Init() {
28 platform_impl_.reset(new PlatformImpl); 28 platform_impl_.reset(new PlatformImpl);
29 blink::initialize(platform_impl_.get()); 29 blink::initialize(platform_impl_.get());
30 30
31 web_view_ = blink::WebView::create(this); 31 web_view_ = blink::WebView::create(this);
32 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); 32 web_view_->setMainFrame(blink::WebLocalFrame::create(this));
33 } 33 }
34 34
35 void Engine::OnViewportMetricsChanged(const gfx::Size& size,
36 float device_pixel_ratio) {
37 blink::WebSize web_size(size.width() / device_pixel_ratio,
38 size.height() / device_pixel_ratio);
39 web_view_->setDeviceScaleFactor(device_pixel_ratio);
40 web_view_->resize(web_size);
41 }
42
35 } // namespace shell 43 } // namespace shell
36 } // namespace sky 44 } // namespace sky
OLDNEW
« 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