| 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 "mash/session/session.h" | 5 #include "mash/session/session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/public/common/service_names.mojom.h" | |
| 11 #include "mash/common/config.h" | 10 #include "mash/common/config.h" |
| 12 #include "mash/quick_launch/public/interfaces/constants.mojom.h" | 11 #include "mash/quick_launch/public/interfaces/constants.mojom.h" |
| 13 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
| 14 #include "services/service_manager/public/cpp/service_context.h" | 13 #include "services/service_manager/public/cpp/service_context.h" |
| 15 | 14 |
| 16 namespace mash { | 15 namespace mash { |
| 17 namespace session { | 16 namespace session { |
| 18 | 17 |
| 19 Session::Session() {} | 18 Session::Session() {} |
| 20 Session::~Session() {} | 19 Session::~Session() {} |
| 21 | 20 |
| 22 void Session::OnStart() { | 21 void Session::OnStart() { |
| 23 StartWindowManager(); | 22 StartWindowManager(); |
| 24 StartQuickLaunch(); | 23 StartQuickLaunch(); |
| 25 | |
| 26 // Launch a chrome window for dev convience; don't do this in the long term. | |
| 27 context()->connector()->StartService( | |
| 28 content::mojom::kPackagedServicesServiceName); | |
| 29 } | 24 } |
| 30 | 25 |
| 31 void Session::StartWindowManager() { | 26 void Session::StartWindowManager() { |
| 32 // TODO(beng): monitor this service for death & bring down the whole system | 27 // TODO(beng): monitor this service for death & bring down the whole system |
| 33 // if necessary. | 28 // if necessary. |
| 34 context()->connector()->StartService(common::GetWindowManagerServiceName()); | 29 context()->connector()->StartService(common::GetWindowManagerServiceName()); |
| 35 } | 30 } |
| 36 | 31 |
| 37 void Session::StartQuickLaunch() { | 32 void Session::StartQuickLaunch() { |
| 38 // TODO(beng): monitor this service for death & bring down the whole system | 33 // TODO(beng): monitor this service for death & bring down the whole system |
| 39 // if necessary. | 34 // if necessary. |
| 40 context()->connector()->StartService(quick_launch::mojom::kServiceName); | 35 context()->connector()->StartService(quick_launch::mojom::kServiceName); |
| 41 } | 36 } |
| 42 | 37 |
| 43 } // namespace session | 38 } // namespace session |
| 44 } // namespace main | 39 } // namespace main |
| OLD | NEW |