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

Unified Diff: services/ui/view_manager/view_manager_app.cc

Issue 1415493003: mozart: Initial commit of the view manager. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 | « services/ui/view_manager/view_manager_app.h ('k') | services/ui/view_manager/view_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/view_manager/view_manager_app.cc
diff --git a/services/ui/view_manager/view_manager_app.cc b/services/ui/view_manager/view_manager_app.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2190590211927da938ae1b2e5c4282d0938a5cc6
--- /dev/null
+++ b/services/ui/view_manager/view_manager_app.cc
@@ -0,0 +1,44 @@
+// 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 "base/trace_event/trace_event.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/common/tracing_impl.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "services/ui/view_manager/view_manager_app.h"
+#include "services/ui/view_manager/view_manager_impl.h"
+
+namespace view_manager {
+
+ViewManagerApp::ViewManagerApp() : app_impl_(nullptr) {}
+
+ViewManagerApp::~ViewManagerApp() {}
+
+void ViewManagerApp::Initialize(mojo::ApplicationImpl* app_impl) {
+ app_impl_ = app_impl;
+ tracing_.Initialize(app_impl);
+
+ mojo::SurfacePtr surfaces;
+ app_impl->ConnectToService("mojo:surfaces_service", &surfaces);
+ surface_manager_.reset(new SurfaceManager(surfaces.Pass()));
+
+ registry_.reset(new ViewRegistry(surface_manager_.get()));
+}
+
+bool ViewManagerApp::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ connection->AddService<mojo::ui::ViewManager>(this);
+ return true;
+}
+
+void ViewManagerApp::Create(
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::ui::ViewManager> request) {
+ view_managers.AddBinding(new ViewManagerImpl(registry_.get()),
+ request.Pass());
+}
+
+} // namespace view_manager
« no previous file with comments | « services/ui/view_manager/view_manager_app.h ('k') | services/ui/view_manager/view_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698