| OLD | NEW | 
|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/launcher/launch_instance.h" | 5 #include "services/ui/launcher/launch_instance.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/command_line.h" |  | 
| 9 #include "base/logging.h" | 8 #include "base/logging.h" | 
| 10 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" | 
| 11 #include "mojo/application/application_runner_chromium.h" |  | 
| 12 #include "mojo/public/c/system/main.h" |  | 
| 13 #include "mojo/public/cpp/application/application_impl.h" |  | 
| 14 #include "mojo/public/cpp/application/connect.h" |  | 
| 15 #include "services/ui/launcher/launcher_view_tree.h" | 10 #include "services/ui/launcher/launcher_view_tree.h" | 
| 16 | 11 | 
| 17 namespace launcher { | 12 namespace launcher { | 
| 18 | 13 | 
| 19 LaunchInstance::LaunchInstance(mojo::ApplicationImpl* app_impl, | 14 LaunchInstance::LaunchInstance(mojo::NativeViewportPtr viewport, | 
| 20                                mojo::NativeViewportPtr viewport, |  | 
| 21                                mojo::ui::ViewProviderPtr view_provider, | 15                                mojo::ui::ViewProviderPtr view_provider, | 
| 22                                mojo::gfx::composition::Compositor* compositor, | 16                                mojo::gfx::composition::Compositor* compositor, | 
| 23                                mojo::ui::ViewManager* view_manager, | 17                                mojo::ui::ViewManager* view_manager, | 
| 24                                const base::Closure& shutdown_callback) | 18                                const base::Closure& shutdown_callback) | 
| 25     : app_impl_(app_impl), | 19     : viewport_(viewport.Pass()), | 
| 26       viewport_(viewport.Pass()), |  | 
| 27       view_provider_(view_provider.Pass()), | 20       view_provider_(view_provider.Pass()), | 
| 28       compositor_(compositor), | 21       compositor_(compositor), | 
| 29       view_manager_(view_manager), | 22       view_manager_(view_manager), | 
| 30       shutdown_callback_(shutdown_callback), | 23       shutdown_callback_(shutdown_callback), | 
| 31       viewport_event_dispatcher_binding_(this) {} | 24       viewport_event_dispatcher_binding_(this) {} | 
| 32 | 25 | 
| 33 LaunchInstance::~LaunchInstance() {} | 26 LaunchInstance::~LaunchInstance() {} | 
| 34 | 27 | 
| 35 void LaunchInstance::Launch() { | 28 void LaunchInstance::Launch() { | 
| 36   TRACE_EVENT0("launcher", __func__); | 29   TRACE_EVENT0("launcher", __func__); | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 93 } | 86 } | 
| 94 | 87 | 
| 95 void LaunchInstance::OnEvent(mojo::EventPtr event, | 88 void LaunchInstance::OnEvent(mojo::EventPtr event, | 
| 96                              const mojo::Callback<void()>& callback) { | 89                              const mojo::Callback<void()>& callback) { | 
| 97   if (view_tree_) | 90   if (view_tree_) | 
| 98     view_tree_->DispatchEvent(event.Pass()); | 91     view_tree_->DispatchEvent(event.Pass()); | 
| 99   callback.Run(); | 92   callback.Run(); | 
| 100 } | 93 } | 
| 101 | 94 | 
| 102 }  // namespace launcher | 95 }  // namespace launcher | 
| OLD | NEW | 
|---|