| 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 "services/window_manager/window_manager_app.h" | 5 #include "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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
| 50 // WindowManagerApp, public: | 50 // WindowManagerApp, public: |
| 51 | 51 |
| 52 WindowManagerApp::WindowManagerApp( | 52 WindowManagerApp::WindowManagerApp( |
| 53 ViewManagerDelegate* view_manager_delegate, | 53 ViewManagerDelegate* view_manager_delegate, |
| 54 WindowManagerDelegate* window_manager_delegate) | 54 WindowManagerDelegate* window_manager_delegate) |
| 55 : shell_(nullptr), | 55 : shell_(nullptr), |
| 56 native_viewport_event_dispatcher_factory_(this), | 56 native_viewport_event_dispatcher_factory_(this), |
| 57 wrapped_view_manager_delegate_(view_manager_delegate), | 57 wrapped_view_manager_delegate_(view_manager_delegate), |
| 58 window_manager_delegate_(window_manager_delegate), | 58 window_manager_delegate_(window_manager_delegate), |
| 59 root_(nullptr), | 59 root_(nullptr) { |
| 60 gesture_provider_(this) { | |
| 61 } | 60 } |
| 62 | 61 |
| 63 WindowManagerApp::~WindowManagerApp() { | 62 WindowManagerApp::~WindowManagerApp() { |
| 64 // TODO(msw|sky): Should this destructor explicitly delete the ViewManager? | 63 // TODO(msw|sky): Should this destructor explicitly delete the ViewManager? |
| 65 mojo::ViewManager* cached_view_manager = view_manager(); | 64 mojo::ViewManager* cached_view_manager = view_manager(); |
| 66 for (RegisteredViewIdSet::const_iterator it = registered_view_id_set_.begin(); | 65 for (RegisteredViewIdSet::const_iterator it = registered_view_id_set_.begin(); |
| 67 cached_view_manager && it != registered_view_id_set_.end(); ++it) { | 66 cached_view_manager && it != registered_view_id_set_.end(); ++it) { |
| 68 View* view = cached_view_manager->GetViewById(*it); | 67 View* view = cached_view_manager->GetViewById(*it); |
| 69 if (view && view == root_) | 68 if (view && view == root_) |
| 70 root_ = nullptr; | 69 root_ = nullptr; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 uint16_t connection_id, | 386 uint16_t connection_id, |
| 388 mojo::ScopedMessagePipeHandle window_manager_pipe) { | 387 mojo::ScopedMessagePipeHandle window_manager_pipe) { |
| 389 // TODO(sky): pass in |connection_id| for validation. | 388 // TODO(sky): pass in |connection_id| for validation. |
| 390 WindowManagerImpl* wm = new WindowManagerImpl(this, true); | 389 WindowManagerImpl* wm = new WindowManagerImpl(this, true); |
| 391 wm->Bind(window_manager_pipe.Pass()); | 390 wm->Bind(window_manager_pipe.Pass()); |
| 392 // WindowManagerImpl is deleted when the connection has an error, or from our | 391 // WindowManagerImpl is deleted when the connection has an error, or from our |
| 393 // destructor. | 392 // destructor. |
| 394 } | 393 } |
| 395 | 394 |
| 396 } // namespace window_manager | 395 } // namespace window_manager |
| OLD | NEW |