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/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "components/mus/public/cpp/event_matcher.h" | 10 #include "components/mus/public/cpp/event_matcher.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { | 122 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { |
123 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); | 123 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); |
124 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); | 124 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); |
125 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") | 125 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") |
126 connection->GetInterface(&session_); | 126 connection->GetInterface(&session_); |
127 return true; | 127 return true; |
128 } | 128 } |
129 | 129 |
| 130 void WindowManagerApplication::ShellConnectionLost() { |
| 131 _exit(1); |
| 132 } |
| 133 |
130 void WindowManagerApplication::Create( | 134 void WindowManagerApplication::Create( |
131 mojo::Connection* connection, | 135 mojo::Connection* connection, |
132 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 136 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
133 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 137 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
134 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 138 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
135 std::move(request)); | 139 std::move(request)); |
136 } else { | 140 } else { |
137 user_window_controller_requests_.push_back(make_scoped_ptr( | 141 user_window_controller_requests_.push_back(make_scoped_ptr( |
138 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( | 142 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( |
139 std::move(request)))); | 143 std::move(request)))); |
(...skipping 20 matching lines...) Expand all Loading... |
160 | 164 |
161 void WindowManagerApplication::CreateWindowManager( | 165 void WindowManagerApplication::CreateWindowManager( |
162 mus::mojom::DisplayPtr display, | 166 mus::mojom::DisplayPtr display, |
163 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 167 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
164 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 168 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
165 this, std::move(display), std::move(client_request))); | 169 this, std::move(display), std::move(client_request))); |
166 } | 170 } |
167 | 171 |
168 } // namespace wm | 172 } // namespace wm |
169 } // namespace mash | 173 } // namespace mash |
OLD | NEW |