OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "services/ui/view_manager/view_manager_app.h" | 5 #include "services/ui/view_manager/view_manager_app.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void ViewManagerApp::Initialize(mojo::ApplicationImpl* app_impl) { | 27 void ViewManagerApp::Initialize(mojo::ApplicationImpl* app_impl) { |
28 app_impl_ = app_impl; | 28 app_impl_ = app_impl; |
29 | 29 |
30 auto command_line = base::CommandLine::ForCurrentProcess(); | 30 auto command_line = base::CommandLine::ForCurrentProcess(); |
31 command_line->InitFromArgv(app_impl_->args()); | 31 command_line->InitFromArgv(app_impl_->args()); |
32 logging::LoggingSettings settings; | 32 logging::LoggingSettings settings; |
33 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 33 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
34 logging::InitLogging(settings); | 34 logging::InitLogging(settings); |
35 | 35 |
36 tracing_.Initialize(app_impl_); | 36 tracing_.Initialize(app_impl_->shell(), &app_impl_->args()); |
37 | 37 |
38 // Connect to compositor. | 38 // Connect to compositor. |
39 mojo::gfx::composition::CompositorPtr compositor; | 39 mojo::gfx::composition::CompositorPtr compositor; |
40 mojo::ConnectToService(app_impl_->shell(), "mojo:compositor_service", | 40 mojo::ConnectToService(app_impl_->shell(), "mojo:compositor_service", |
41 GetProxy(&compositor)); | 41 GetProxy(&compositor)); |
42 compositor.set_connection_error_handler(base::Bind( | 42 compositor.set_connection_error_handler(base::Bind( |
43 &ViewManagerApp::OnCompositorConnectionError, base::Unretained(this))); | 43 &ViewManagerApp::OnCompositorConnectionError, base::Unretained(this))); |
44 | 44 |
45 // Create the registry. | 45 // Create the registry. |
46 registry_.reset(new ViewRegistry(compositor.Pass())); | 46 registry_.reset(new ViewRegistry(compositor.Pass())); |
(...skipping 14 matching lines...) Expand all Loading... |
61 void ViewManagerApp::OnCompositorConnectionError() { | 61 void ViewManagerApp::OnCompositorConnectionError() { |
62 LOG(ERROR) << "Exiting due to compositor connection error."; | 62 LOG(ERROR) << "Exiting due to compositor connection error."; |
63 Shutdown(); | 63 Shutdown(); |
64 } | 64 } |
65 | 65 |
66 void ViewManagerApp::Shutdown() { | 66 void ViewManagerApp::Shutdown() { |
67 app_impl_->Terminate(); | 67 app_impl_->Terminate(); |
68 } | 68 } |
69 | 69 |
70 } // namespace view_manager | 70 } // namespace view_manager |
OLD | NEW |