Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: mojo/services/public/cpp/view_manager/view_manager.h

Issue 311373005: Nesting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 54caf789f7d8c95066d0ffc050371b8ea62463a4..4242bcca2e58bda5411c53a1ce4f32b4eeedb922 100644
--- a/mojo/services/public/cpp/view_manager/view_manager.h
+++ b/mojo/services/public/cpp/view_manager/view_manager.h
@@ -18,28 +18,19 @@ class Application;
namespace view_manager {
class View;
+class ViewManagerDelegate;
class ViewManagerSynchronizer;
class ViewTreeNode;
// Approximately encapsulates the View Manager service.
// Has a synchronizer that keeps a client model in sync with the service.
// Owned by the connection.
-//
-// TODO: displays
class ViewManager {
public:
- typedef base::Callback<void(ViewManager*, ViewTreeNode*)> RootCallback;
-
~ViewManager();
- // |ready_callback| is run when the ViewManager connection is established
- // and ready to use.
- static void Create(
- Application* application,
- const RootCallback& root_added_callback,
- const RootCallback& root_removed_callback);
- // Blocks until ViewManager is ready to use.
- static ViewManager* CreateBlocking(Application* application);
+ // Delegate is owned by the caller.
+ static void Create(Application* application, ViewManagerDelegate* delegate);
const std::vector<ViewTreeNode*>& roots() { return roots_; }
@@ -48,16 +39,17 @@ class ViewManager {
private:
friend class ViewManagerPrivate;
+ friend class ViewManagerSynchronizer;
+
typedef std::map<TransportNodeId, ViewTreeNode*> IdToNodeMap;
typedef std::map<TransportViewId, View*> IdToViewMap;
+ typedef std::map<TransportConnectionId,
+ ViewManagerSynchronizer*> SynchronizerMap;
- ViewManager(Application* application,
- const RootCallback& root_added_callback,
- const RootCallback& root_removed_callback);
-
- RootCallback root_added_callback_;
- RootCallback root_removed_callback_;
+ ViewManager(ViewManagerSynchronizer* synchronizer,
+ ViewManagerDelegate* delegate);
+ ViewManagerDelegate* delegate_;
ViewManagerSynchronizer* synchronizer_;
std::vector<ViewTreeNode*> roots_;

Powered by Google App Engine
This is Rietveld 408576698