| Index: trunk/src/mojo/services/public/cpp/view_manager/lib/view_manager.cc
|
| ===================================================================
|
| --- trunk/src/mojo/services/public/cpp/view_manager/lib/view_manager.cc (revision 274327)
|
| +++ trunk/src/mojo/services/public/cpp/view_manager/lib/view_manager.cc (working copy)
|
| @@ -4,8 +4,6 @@
|
|
|
| #include "mojo/services/public/cpp/view_manager/view_manager.h"
|
|
|
| -#include "base/message_loop/message_loop.h"
|
| -#include "mojo/public/cpp/application/application.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"
|
| #include "mojo/services/public/cpp/view_manager/view.h"
|
| @@ -13,13 +11,8 @@
|
| namespace mojo {
|
| namespace view_manager {
|
|
|
| -ViewManager::ViewManager(Application* application)
|
| - : synchronizer_(NULL),
|
| - tree_(NULL) {
|
| - application->AddService<ViewManagerSynchronizer>(this);
|
| - // Block in a nested message loop until the ViewManagerSynchronizer is set up.
|
| - base::MessageLoop::current()->Run();
|
| -}
|
| +ViewManager::ViewManager(ServiceProvider* service_provider)
|
| + : service_provider_(service_provider) {}
|
|
|
| ViewManager::~ViewManager() {
|
| while (!nodes_.empty()) {
|
| @@ -38,6 +31,10 @@
|
| }
|
| }
|
|
|
| +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;
|
| @@ -48,9 +45,5 @@
|
| return it != views_.end() ? it->second : NULL;
|
| }
|
|
|
| -void ViewManager::Embed(const String& url, ViewTreeNode* node) {
|
| - synchronizer_->Embed(url, node->id());
|
| -}
|
| -
|
| } // namespace view_manager
|
| } // namespace mojo
|
|
|