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

Side by Side 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, 1 month 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
(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 "base/trace_event/trace_event.h"
6 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/common/tracing_impl.h"
8 #include "mojo/public/c/system/main.h"
9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/public/cpp/application/application_impl.h"
11 #include "services/ui/view_manager/view_manager_app.h"
12 #include "services/ui/view_manager/view_manager_impl.h"
13
14 namespace view_manager {
15
16 ViewManagerApp::ViewManagerApp() : app_impl_(nullptr) {}
17
18 ViewManagerApp::~ViewManagerApp() {}
19
20 void ViewManagerApp::Initialize(mojo::ApplicationImpl* app_impl) {
21 app_impl_ = app_impl;
22 tracing_.Initialize(app_impl);
23
24 mojo::SurfacePtr surfaces;
25 app_impl->ConnectToService("mojo:surfaces_service", &surfaces);
26 surface_manager_.reset(new SurfaceManager(surfaces.Pass()));
27
28 registry_.reset(new ViewRegistry(surface_manager_.get()));
29 }
30
31 bool ViewManagerApp::ConfigureIncomingConnection(
32 mojo::ApplicationConnection* connection) {
33 connection->AddService<mojo::ui::ViewManager>(this);
34 return true;
35 }
36
37 void ViewManagerApp::Create(
38 mojo::ApplicationConnection* connection,
39 mojo::InterfaceRequest<mojo::ui::ViewManager> request) {
40 view_managers.AddBinding(new ViewManagerImpl(registry_.get()),
41 request.Pass());
42 }
43
44 } // namespace view_manager
OLDNEW
« 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