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

Unified Diff: sky/viewer/sky_viewer_base.cc

Issue 1083273003: Expose some sky_viewer plumbing to allow for reuse (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/viewer/sky_viewer_base.h ('k') | sky/viewer/viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/sky_viewer_base.cc
diff --git a/sky/viewer/sky_viewer_base.cc b/sky/viewer/sky_viewer_base.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f9a46dfd8b8e96c9868f52f22627a2c34472fce2
--- /dev/null
+++ b/sky/viewer/sky_viewer_base.cc
@@ -0,0 +1,37 @@
+// 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/viewer/sky_viewer_base.h"
+
+#include "sky/engine/public/web/Sky.h"
+#include "sky/viewer/runtime_flags.h"
+
+namespace sky {
+
+SkyViewerBase::SkyViewerBase() {
+}
+
+SkyViewerBase::~SkyViewerBase() {
+ blink::shutdown();
+}
+
+void SkyViewerBase::Initialize(mojo::ApplicationImpl* app) {
+ RuntimeFlags::Initialize(app);
+
+ mojo::NetworkServicePtr network_service;
+ app->ConnectToService("mojo:network_service", &network_service);
+ platform_impl_.reset(new PlatformImpl(network_service.Pass()));
+ blink::initialize(platform_impl_.get());
+
+ mojo::icu::Initialize(app);
+ tracing_.Initialize(app);
+}
+
+bool SkyViewerBase::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ connection->AddService<mojo::ContentHandler>(this);
+ return true;
+}
+
+} // namespace sky
« no previous file with comments | « sky/viewer/sky_viewer_base.h ('k') | sky/viewer/viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698