OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "sky/shell/ui/engine.h" |
| 6 |
| 7 #include "sky/engine/public/web/Sky.h" |
| 8 #include "sky/engine/public/web/WebLocalFrame.h" |
| 9 #include "sky/engine/public/web/WebView.h" |
| 10 #include "sky/shell/ui/platform_impl.h" |
| 11 |
| 12 namespace sky { |
| 13 namespace shell { |
| 14 |
| 15 Engine::Engine() : web_view_(nullptr), weak_factory_(this) { |
| 16 } |
| 17 |
| 18 Engine::~Engine() { |
| 19 if (web_view_) |
| 20 web_view_->close(); |
| 21 } |
| 22 |
| 23 base::WeakPtr<Engine> Engine::GetWeakPtr() { |
| 24 return weak_factory_.GetWeakPtr(); |
| 25 } |
| 26 |
| 27 void Engine::Init() { |
| 28 platform_impl_.reset(new PlatformImpl); |
| 29 blink::initialize(platform_impl_.get()); |
| 30 |
| 31 web_view_ = blink::WebView::create(this); |
| 32 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
| 33 } |
| 34 |
| 35 } // namespace shell |
| 36 } // namespace sky |
OLD | NEW |