| Index: mojo/services/public/cpp/view_manager/lib/view_manager.cc
|
| diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager.cc b/mojo/services/public/cpp/view_manager/lib/view_manager.cc
|
| index 4603abc3db11cddec574b742dc150dd1e67b7290..9325a9950859f7ae7f99ce829f6107b33f3aa287 100644
|
| --- a/mojo/services/public/cpp/view_manager/lib/view_manager.cc
|
| +++ b/mojo/services/public/cpp/view_manager/lib/view_manager.cc
|
| @@ -5,6 +5,7 @@
|
| #include "mojo/services/public/cpp/view_manager/view_manager.h"
|
|
|
| #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h"
|
| +#include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h"
|
|
|
| namespace mojo {
|
| namespace services {
|
| @@ -13,12 +14,25 @@ namespace view_manager {
|
| ViewManager::ViewManager(Shell* shell)
|
| : shell_(shell) {}
|
|
|
| -ViewManager::~ViewManager() {}
|
| +ViewManager::~ViewManager() {
|
| + while (!nodes_.empty()) {
|
| + IdToNodeMap::iterator it = nodes_.begin();
|
| + if (synchronizer_->OwnsNode(it->second->id()))
|
| + it->second->Destroy();
|
| + else
|
| + nodes_.erase(it);
|
| + }
|
| +}
|
|
|
| void ViewManager::Init() {
|
| synchronizer_.reset(new ViewManagerSynchronizer(this));
|
| }
|
|
|
| +ViewTreeNode* ViewManager::GetNodeById(TransportNodeId id) {
|
| + IdToNodeMap::const_iterator it = nodes_.find(id);
|
| + return it != nodes_.end() ? it->second : NULL;
|
| +}
|
| +
|
| } // namespace view_manager
|
| } // namespace services
|
| } // namespace mojo
|
|
|