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/aura/aura_init.h" | 9 #include "mojo/aura/aura_init.h" |
10 #include "mojo/aura/window_tree_host_mojo.h" | 10 #include "mojo/aura/window_tree_host_mojo.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 window->SetProperty(kNodeKey, node); | 254 window->SetProperty(kNodeKey, node); |
255 parent->AddChild(window); | 255 parent->AddChild(window); |
256 node_id_to_window_map_[id] = window; | 256 node_id_to_window_map_[id] = window; |
257 view_manager::Node::Children::const_iterator it = node->children().begin(); | 257 view_manager::Node::Children::const_iterator it = node->children().begin(); |
258 for (; it != node->children().end(); ++it) | 258 for (; it != node->children().end(); ++it) |
259 RegisterSubtree((*it)->id(), window); | 259 RegisterSubtree((*it)->id(), window); |
260 } | 260 } |
261 | 261 |
262 void WindowManagerApp::UnregisterSubtree(view_manager::Id id) { | 262 void WindowManagerApp::UnregisterSubtree(view_manager::Id id) { |
263 view_manager::Node* node = view_manager_->GetNodeById(id); | 263 view_manager::Node* node = view_manager_->GetNodeById(id); |
264 NodeIdToWindowMap::const_iterator it = node_id_to_window_map_.find(id); | 264 NodeIdToWindowMap::iterator it = node_id_to_window_map_.find(id); |
265 DCHECK(it != node_id_to_window_map_.end()); | 265 DCHECK(it != node_id_to_window_map_.end()); |
266 scoped_ptr<aura::Window> window(it->second); | 266 scoped_ptr<aura::Window> window(it->second); |
267 node_id_to_window_map_.erase(it); | 267 node_id_to_window_map_.erase(it); |
268 view_manager::Node::Children::const_iterator child = node->children().begin(); | 268 view_manager::Node::Children::const_iterator child = node->children().begin(); |
269 for (; child != node->children().end(); ++child) | 269 for (; child != node->children().end(); ++child) |
270 UnregisterSubtree((*child)->id()); | 270 UnregisterSubtree((*child)->id()); |
271 } | 271 } |
272 | 272 |
273 //////////////////////////////////////////////////////////////////////////////// | 273 //////////////////////////////////////////////////////////////////////////////// |
274 // ApplicationDelegate, public: | 274 // ApplicationDelegate, public: |
275 | 275 |
276 // static | 276 // static |
277 ApplicationDelegate* ApplicationDelegate::Create() { | 277 ApplicationDelegate* ApplicationDelegate::Create() { |
278 return new WindowManagerApp; | 278 return new WindowManagerApp; |
279 } | 279 } |
280 | 280 |
281 } // namespace mojo | 281 } // namespace mojo |
OLD | NEW |