| Index: mojo/services/public/cpp/view_manager/view_manager.h
|
| diff --git a/mojo/services/public/cpp/view_manager/view_manager.h b/mojo/services/public/cpp/view_manager/view_manager.h
|
| index 8380581b8a40385e2515fe235544a4765c318488..edfe2c1a0e1ff548968bdff77a526a45ff5843f4 100644
|
| --- a/mojo/services/public/cpp/view_manager/view_manager.h
|
| +++ b/mojo/services/public/cpp/view_manager/view_manager.h
|
| @@ -13,7 +13,7 @@
|
| #include "mojo/services/public/cpp/view_manager/view_tree_node.h"
|
|
|
| namespace mojo {
|
| -class ServiceProvider;
|
| +class Application;
|
| namespace view_manager {
|
|
|
| class View;
|
| @@ -21,17 +21,12 @@ class ViewManagerSynchronizer;
|
| class ViewTreeNode;
|
|
|
| // Approximately encapsulates the View Manager service.
|
| -// Owns a synchronizer that keeps a client model in sync with the service.
|
| -// Owned by the creator.
|
| +// Has a synchronizer that keeps a client model in sync with the service.
|
| +// Owned by the connection.
|
| //
|
| // TODO: displays
|
| class ViewManager {
|
| public:
|
| - explicit ViewManager(ServiceProvider* service_provider);
|
| - ~ViewManager();
|
| -
|
| - // Connects to the View Manager service. This method must be called before
|
| - // using any other View Manager lib class or function.
|
| // Blocks on establishing the connection and subsequently receiving a node
|
| // tree from the service.
|
| // TODO(beng): blocking is currently achieved by running a nested runloop,
|
| @@ -39,20 +34,22 @@ class ViewManager {
|
| // we should instead wait on the client pipe receiving a
|
| // connection established message.
|
| // TODO(beng): this method could optionally not block if supplied a callback.
|
| - void Init();
|
| + explicit ViewManager(Application* application);
|
| + ~ViewManager();
|
|
|
| ViewTreeNode* tree() { return tree_; }
|
|
|
| ViewTreeNode* GetNodeById(TransportNodeId id);
|
| View* GetViewById(TransportViewId id);
|
|
|
| + void Embed(const String& url, ViewTreeNode* node);
|
| +
|
| private:
|
| friend class ViewManagerPrivate;
|
| typedef std::map<TransportNodeId, ViewTreeNode*> IdToNodeMap;
|
| typedef std::map<TransportViewId, View*> IdToViewMap;
|
|
|
| - ServiceProvider* service_provider_;
|
| - scoped_ptr<ViewManagerSynchronizer> synchronizer_;
|
| + ViewManagerSynchronizer* synchronizer_;
|
| ViewTreeNode* tree_;
|
|
|
| IdToNodeMap nodes_;
|
|
|