| 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 "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 |
| OLD | NEW |