| 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 "components/mus/ws/window_tree_host_impl.h" | 5 #include "components/mus/ws/window_tree_host_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/mus/public/cpp/types.h" | 8 #include "components/mus/public/cpp/types.h" |
| 9 #include "components/mus/ws/connection_manager.h" | 9 #include "components/mus/ws/connection_manager.h" |
| 10 #include "components/mus/ws/display_manager.h" | 10 #include "components/mus/ws/display_manager.h" |
| 11 #include "components/mus/ws/focus_controller.h" | 11 #include "components/mus/ws/focus_controller.h" |
| 12 #include "components/mus/ws/window_tree_host_delegate.h" | 12 #include "components/mus/ws/window_tree_host_delegate.h" |
| 13 #include "components/mus/ws/window_tree_impl.h" | 13 #include "components/mus/ws/window_tree_impl.h" |
| 14 #include "mojo/common/common_type_converters.h" | 14 #include "mojo/common/common_type_converters.h" |
| 15 #include "mojo/converters/geometry/geometry_type_converters.h" | 15 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 16 | 16 |
| 17 namespace mus { | 17 namespace mus { |
| 18 namespace ws { | 18 namespace ws { |
| 19 | 19 |
| 20 WindowTreeHostImpl::WindowTreeHostImpl( | 20 WindowTreeHostImpl::WindowTreeHostImpl( |
| 21 mojom::WindowTreeHostClientPtr client, | 21 mojom::WindowTreeHostClientPtr client, |
| 22 ConnectionManager* connection_manager, | 22 ConnectionManager* connection_manager, |
| 23 mojo::ApplicationImpl* app_impl, | 23 mojo::ApplicationImpl* app_impl, |
| 24 const scoped_refptr<GpuState>& gpu_state, | 24 const scoped_refptr<GpuState>& gpu_state, |
| 25 const scoped_refptr<SurfacesState>& surfaces_state) | 25 const scoped_refptr<SurfacesState>& surfaces_state, |
| 26 mojom::WindowManagerPtr window_manager) |
| 26 : delegate_(nullptr), | 27 : delegate_(nullptr), |
| 27 connection_manager_(connection_manager), | 28 connection_manager_(connection_manager), |
| 28 client_(client.Pass()), | 29 client_(client.Pass()), |
| 29 event_dispatcher_(this), | 30 event_dispatcher_(this), |
| 30 display_manager_( | 31 display_manager_( |
| 31 DisplayManager::Create(app_impl, gpu_state, surfaces_state)), | 32 DisplayManager::Create(app_impl, gpu_state, surfaces_state)), |
| 32 focus_controller_(new FocusController(this)) { | 33 focus_controller_(new FocusController(this)), |
| 34 window_manager_(window_manager.Pass()) { |
| 33 display_manager_->Init(this); | 35 display_manager_->Init(this); |
| 34 if (client_) { | 36 if (client_) { |
| 35 client_.set_connection_error_handler(base::Bind( | 37 client_.set_connection_error_handler(base::Bind( |
| 36 &WindowTreeHostImpl::OnClientClosed, base::Unretained(this))); | 38 &WindowTreeHostImpl::OnClientClosed, base::Unretained(this))); |
| 37 } | 39 } |
| 38 } | 40 } |
| 39 | 41 |
| 40 WindowTreeHostImpl::~WindowTreeHostImpl() {} | 42 WindowTreeHostImpl::~WindowTreeHostImpl() {} |
| 41 | 43 |
| 42 void WindowTreeHostImpl::Init(WindowTreeHostDelegate* delegate) { | 44 void WindowTreeHostImpl::Init(WindowTreeHostDelegate* delegate) { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 connection_manager_->GetConnectionWithRoot(target->id()); | 254 connection_manager_->GetConnectionWithRoot(target->id()); |
| 253 if (!connection) | 255 if (!connection) |
| 254 connection = connection_manager_->GetConnection(target->id().connection_id); | 256 connection = connection_manager_->GetConnection(target->id().connection_id); |
| 255 connection->client()->OnWindowInputEvent(WindowIdToTransportId(target->id()), | 257 connection->client()->OnWindowInputEvent(WindowIdToTransportId(target->id()), |
| 256 event.Pass(), | 258 event.Pass(), |
| 257 base::Bind(&base::DoNothing)); | 259 base::Bind(&base::DoNothing)); |
| 258 } | 260 } |
| 259 | 261 |
| 260 } // namespace ws | 262 } // namespace ws |
| 261 } // namespace mus | 263 } // namespace mus |
| OLD | NEW |