| 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 "mash/login/public/interfaces/login.mojom.h" | 10 #include "mash/login/public/interfaces/login.mojom.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 namespace mash { | 24 namespace mash { |
| 25 namespace session { | 25 namespace session { |
| 26 | 26 |
| 27 Session::Session() : screen_locked_(false) {} | 27 Session::Session() : screen_locked_(false) {} |
| 28 Session::~Session() {} | 28 Session::~Session() {} |
| 29 | 29 |
| 30 void Session::OnStart(const service_manager::ServiceInfo& info) { | 30 void Session::OnStart(const service_manager::ServiceInfo& info) { |
| 31 StartAppDriver(); | |
| 32 StartWindowManager(); | 31 StartWindowManager(); |
| 33 StartQuickLaunch(); | 32 StartQuickLaunch(); |
| 34 // Launch a chrome window for dev convience; don't do this in the long term. | 33 // Launch a chrome window for dev convience; don't do this in the long term. |
| 35 connector()->Connect("service:content_browser"); | 34 connector()->Connect("service:content_browser"); |
| 36 } | 35 } |
| 37 | 36 |
| 38 bool Session::OnConnect(const service_manager::ServiceInfo& remote_info, | 37 bool Session::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 39 service_manager::InterfaceRegistry* registry) { | 38 service_manager::InterfaceRegistry* registry) { |
| 40 registry->AddInterface<mojom::Session>(this); | 39 registry->AddInterface<mojom::Session>(this); |
| 41 return true; | 40 return true; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bindings_.AddBinding(this, std::move(request)); | 88 bindings_.AddBinding(this, std::move(request)); |
| 90 } | 89 } |
| 91 | 90 |
| 92 void Session::StartWindowManager() { | 91 void Session::StartWindowManager() { |
| 93 StartRestartableService( | 92 StartRestartableService( |
| 94 "service:ash", | 93 "service:ash", |
| 95 base::Bind(&Session::StartWindowManager, | 94 base::Bind(&Session::StartWindowManager, |
| 96 base::Unretained(this))); | 95 base::Unretained(this))); |
| 97 } | 96 } |
| 98 | 97 |
| 99 void Session::StartAppDriver() { | |
| 100 StartRestartableService( | |
| 101 "service:app_driver", | |
| 102 base::Bind(&Session::StartAppDriver, base::Unretained(this))); | |
| 103 } | |
| 104 | |
| 105 void Session::StartQuickLaunch() { | 98 void Session::StartQuickLaunch() { |
| 106 StartRestartableService( | 99 StartRestartableService( |
| 107 "service:quick_launch", | 100 "service:quick_launch", |
| 108 base::Bind(&Session::StartQuickLaunch, | 101 base::Bind(&Session::StartQuickLaunch, |
| 109 base::Unretained(this))); | 102 base::Unretained(this))); |
| 110 } | 103 } |
| 111 | 104 |
| 112 void Session::StartScreenlock() { | 105 void Session::StartScreenlock() { |
| 113 StartRestartableService( | 106 StartRestartableService( |
| 114 "service:screenlock", | 107 "service:screenlock", |
| (...skipping 18 matching lines...) Expand all Loading... |
| 133 // manager. | 126 // manager. |
| 134 if (connection) { | 127 if (connection) { |
| 135 connection->SetConnectionLostClosure( | 128 connection->SetConnectionLostClosure( |
| 136 base::Bind(&LogAndCallServiceRestartCallback, url, restart_callback)); | 129 base::Bind(&LogAndCallServiceRestartCallback, url, restart_callback)); |
| 137 connections_[url] = std::move(connection); | 130 connections_[url] = std::move(connection); |
| 138 } | 131 } |
| 139 } | 132 } |
| 140 | 133 |
| 141 } // namespace session | 134 } // namespace session |
| 142 } // namespace main | 135 } // namespace main |
| OLD | NEW |