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 "mojo/services/window_manager/window_manager_app.h" | 5 #include "mojo/services/window_manager/window_manager_app.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return; | 321 return; |
322 } | 322 } |
323 view->RemoveObserver(this); | 323 view->RemoveObserver(this); |
324 DCHECK(it != view_id_to_view_target_map_.end()); | 324 DCHECK(it != view_id_to_view_target_map_.end()); |
325 // Delete before we remove from map as destruction may want to look up view | 325 // Delete before we remove from map as destruction may want to look up view |
326 // for window. | 326 // for window. |
327 delete it->second; | 327 delete it->second; |
328 view_id_to_view_target_map_.erase(it); | 328 view_id_to_view_target_map_.erase(it); |
329 } | 329 } |
330 | 330 |
| 331 void WindowManagerApp::DispatchInputEventToView(View* view, EventPtr event) { |
| 332 window_manager_client_->DispatchInputEventToView(view->id(), event.Pass()); |
| 333 } |
| 334 |
331 void WindowManagerApp::SetViewportSize(const gfx::Size& size) { | 335 void WindowManagerApp::SetViewportSize(const gfx::Size& size) { |
332 window_manager_client_->SetViewportSize(Size::From(size)); | 336 window_manager_client_->SetViewportSize(Size::From(size)); |
333 } | 337 } |
334 | 338 |
335 void WindowManagerApp::LaunchViewManager(ApplicationImpl* app) { | 339 void WindowManagerApp::LaunchViewManager(ApplicationImpl* app) { |
336 // TODO(sky): figure out logic if this connection goes away. | 340 // TODO(sky): figure out logic if this connection goes away. |
337 view_manager_client_factory_.reset( | 341 view_manager_client_factory_.reset( |
338 new ViewManagerClientFactory(shell_, this)); | 342 new ViewManagerClientFactory(shell_, this)); |
339 | 343 |
340 MessagePipe pipe; | 344 MessagePipe pipe; |
(...skipping 12 matching lines...) Expand all Loading... |
353 view_manager_app->ConnectToService(&window_manager_client_); | 357 view_manager_app->ConnectToService(&window_manager_client_); |
354 } | 358 } |
355 | 359 |
356 void WindowManagerApp::Create(ApplicationConnection* connection, | 360 void WindowManagerApp::Create(ApplicationConnection* connection, |
357 InterfaceRequest<WindowManagerInternal> request) { | 361 InterfaceRequest<WindowManagerInternal> request) { |
358 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); | 362 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); |
359 BindToRequest(impl, &request); | 363 BindToRequest(impl, &request); |
360 } | 364 } |
361 | 365 |
362 } // namespace mojo | 366 } // namespace mojo |
OLD | NEW |