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 | |
134 void WindowManagerApplication::Create( | 130 void WindowManagerApplication::Create( |
135 mojo::Connection* connection, | 131 mojo::Connection* connection, |
136 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 132 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
137 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 133 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
138 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 134 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
139 std::move(request)); | 135 std::move(request)); |
140 } else { | 136 } else { |
141 user_window_controller_requests_.push_back(make_scoped_ptr( | 137 user_window_controller_requests_.push_back(make_scoped_ptr( |
142 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( | 138 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( |
143 std::move(request)))); | 139 std::move(request)))); |
(...skipping 20 matching lines...) Expand all Loading... |
164 | 160 |
165 void WindowManagerApplication::CreateWindowManager( | 161 void WindowManagerApplication::CreateWindowManager( |
166 mus::mojom::DisplayPtr display, | 162 mus::mojom::DisplayPtr display, |
167 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 163 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
168 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 164 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
169 this, std::move(display), std::move(client_request))); | 165 this, std::move(display), std::move(client_request))); |
170 } | 166 } |
171 | 167 |
172 } // namespace wm | 168 } // namespace wm |
173 } // namespace mash | 169 } // namespace mash |
OLD | NEW |