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

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

Issue 873923003: sky/shell should link with sky/engine (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
new file mode 100644
index 0000000000000000000000000000000000000000..ed1971d3677d276578b3fe96b13c714a2f1bc761
--- /dev/null
+++ b/sky/shell/ui/engine.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sky/shell/ui/engine.h"
+
+#include "sky/engine/public/web/Sky.h"
+#include "sky/engine/public/web/WebLocalFrame.h"
+#include "sky/engine/public/web/WebView.h"
+#include "sky/shell/ui/platform_impl.h"
+
+namespace sky {
+namespace shell {
+
+Engine::Engine() : web_view_(nullptr), weak_factory_(this) {
+}
+
+Engine::~Engine() {
+ if (web_view_)
+ web_view_->close();
+}
+
+base::WeakPtr<Engine> Engine::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
+void Engine::Init() {
+ platform_impl_.reset(new PlatformImpl);
+ blink::initialize(platform_impl_.get());
+
+ web_view_ = blink::WebView::create(this);
+ web_view_->setMainFrame(blink::WebLocalFrame::create(this));
+}
+
+} // namespace shell
+} // namespace sky
« sky/shell/ui/engine.h ('K') | « sky/shell/ui/engine.h ('k') | sky/shell/ui/platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698