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/view_manager/root_node_manager.h" | 5 #include "mojo/services/view_manager/root_node_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/public/cpp/application/application_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
9 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 9 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 RootNodeManager::Context::Context() { | 36 RootNodeManager::Context::Context() { |
37 // Pass in false as native viewport creates the PlatformEventSource. | 37 // Pass in false as native viewport creates the PlatformEventSource. |
38 aura::Env::CreateInstance(false); | 38 aura::Env::CreateInstance(false); |
39 } | 39 } |
40 | 40 |
41 RootNodeManager::Context::~Context() { | 41 RootNodeManager::Context::~Context() { |
42 aura::Env::DeleteInstance(); | 42 aura::Env::DeleteInstance(); |
43 } | 43 } |
44 | 44 |
45 RootNodeManager::RootNodeManager(ApplicationConnection* app_connection, | 45 RootNodeManager::RootNodeManager( |
46 RootViewManagerDelegate* view_manager_delegate) | 46 ApplicationConnection* app_connection, |
| 47 RootViewManagerDelegate* view_manager_delegate, |
| 48 const Callback<void()>& native_viewport_closed_callback) |
47 : app_connection_(app_connection), | 49 : app_connection_(app_connection), |
48 next_connection_id_(1), | 50 next_connection_id_(1), |
49 next_server_change_id_(1), | 51 next_server_change_id_(1), |
50 root_view_manager_(app_connection, this, view_manager_delegate), | 52 root_view_manager_(app_connection, |
| 53 this, |
| 54 view_manager_delegate, |
| 55 native_viewport_closed_callback), |
51 root_(new Node(this, RootNodeId())), | 56 root_(new Node(this, RootNodeId())), |
52 current_change_(NULL) { | 57 current_change_(NULL) { |
53 } | 58 } |
54 | 59 |
55 RootNodeManager::~RootNodeManager() { | 60 RootNodeManager::~RootNodeManager() { |
56 aura::client::FocusClient* focus_client = | 61 aura::client::FocusClient* focus_client = |
57 aura::client::GetFocusClient(root_->window()); | 62 aura::client::GetFocusClient(root_->window()); |
58 focus_client->RemoveObserver(this); | 63 focus_client->RemoveObserver(this); |
59 while (!connections_created_by_connect_.empty()) | 64 while (!connections_created_by_connect_.empty()) |
60 delete *(connections_created_by_connect_.begin()); | 65 delete *(connections_created_by_connect_.begin()); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 289 } |
285 | 290 |
286 void RootNodeManager::OnViewInputEvent(const View* view, | 291 void RootNodeManager::OnViewInputEvent(const View* view, |
287 const ui::Event* event) { | 292 const ui::Event* event) { |
288 DispatchViewInputEventToWindowManager(view, event); | 293 DispatchViewInputEventToWindowManager(view, event); |
289 } | 294 } |
290 | 295 |
291 } // namespace service | 296 } // namespace service |
292 } // namespace view_manager | 297 } // namespace view_manager |
293 } // namespace mojo | 298 } // namespace mojo |
OLD | NEW |