OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/ws/client_connection.h" | 5 #include "components/mus/ws/client_connection.h" |
6 | 6 |
7 #include "components/mus/ws/connection_manager.h" | 7 #include "components/mus/ws/connection_manager.h" |
8 #include "components/mus/ws/window_tree_impl.h" | 8 #include "components/mus/ws/window_tree_impl.h" |
9 | 9 |
10 namespace mus { | 10 namespace mus { |
11 | |
12 namespace ws { | 11 namespace ws { |
13 | 12 |
14 ClientConnection::ClientConnection(scoped_ptr<WindowTreeImpl> service, | 13 ClientConnection::ClientConnection(scoped_ptr<WindowTreeImpl> service, |
15 mojom::WindowTreeClient* client) | 14 mojom::WindowTreeClient* client) |
16 : service_(std::move(service)), client_(client) {} | 15 : service_(std::move(service)), client_(client) {} |
17 | 16 |
18 ClientConnection::~ClientConnection() {} | 17 ClientConnection::~ClientConnection() {} |
19 | 18 |
20 DefaultClientConnection::DefaultClientConnection( | 19 DefaultClientConnection::DefaultClientConnection( |
21 scoped_ptr<WindowTreeImpl> service_impl, | 20 scoped_ptr<WindowTreeImpl> service_impl, |
22 ConnectionManager* connection_manager, | 21 ConnectionManager* connection_manager, |
23 mojo::InterfaceRequest<mojom::WindowTree> service_request, | 22 mojo::InterfaceRequest<mojom::WindowTree> service_request, |
24 mojom::WindowTreeClientPtr client) | 23 mojom::WindowTreeClientPtr client) |
25 : ClientConnection(std::move(service_impl), client.get()), | 24 : ClientConnection(std::move(service_impl), client.get()), |
26 connection_manager_(connection_manager), | 25 connection_manager_(connection_manager), |
27 binding_(service(), std::move(service_request)), | 26 binding_(service(), std::move(service_request)), |
28 client_(std::move(client)) { | 27 client_(std::move(client)) { |
29 binding_.set_connection_error_handler( | 28 binding_.set_connection_error_handler( |
30 [this]() { connection_manager_->OnConnectionError(this); }); | 29 [this]() { connection_manager_->OnConnectionError(this); }); |
31 } | 30 } |
32 | 31 |
33 DefaultClientConnection::~DefaultClientConnection() {} | 32 DefaultClientConnection::~DefaultClientConnection() {} |
34 | 33 |
| 34 void DefaultClientConnection::SetIncomingMethodCallProcessingPaused( |
| 35 bool paused) { |
| 36 if (paused) |
| 37 binding_.PauseIncomingMethodCallProcessing(); |
| 38 else |
| 39 binding_.ResumeIncomingMethodCallProcessing(); |
| 40 } |
| 41 |
35 mojom::WindowManagerInternal* | 42 mojom::WindowManagerInternal* |
36 DefaultClientConnection::GetWindowManagerInternal() { | 43 DefaultClientConnection::GetWindowManagerInternal() { |
37 client_->GetWindowManagerInternal( | 44 client_->GetWindowManagerInternal( |
38 GetProxy(&window_manager_internal_, client_.associated_group())); | 45 GetProxy(&window_manager_internal_, client_.associated_group())); |
39 return window_manager_internal_.get(); | 46 return window_manager_internal_.get(); |
40 } | 47 } |
41 | 48 |
42 } // namespace ws | 49 } // namespace ws |
43 | |
44 } // namespace mus | 50 } // namespace mus |
OLD | NEW |