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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager.cc

Issue 316083002: Add support for multiple roots to the client lib. (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/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 936387f18ba5d37f6accb880adcbe5ff194a6666..5c36f55eda0abf63a617cdb78479a1b3994aac9b 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager.cc
@@ -43,7 +43,9 @@ ViewManager::~ViewManager() {
}
// static
-ViewManager* ViewManager::CreateBlocking(Application* application) {
+ViewManager* ViewManager::CreateBlocking(
+ Application* application,
+ const base::Callback<void(ViewManager*)>& root_added_callback) {
base::RunLoop init_loop;
ViewManager* manager = new ViewManager(
application,
@@ -55,8 +57,8 @@ ViewManager* ViewManager::CreateBlocking(Application* application) {
// static
void ViewManager::Create(
Application* application,
- const base::Callback<void(ViewManager*)> ready_callback) {
- new ViewManager(application, ready_callback);
+ const base::Callback<void(ViewManager*)>& root_added_callback) {
+ new ViewManager(application, root_added_callback);
}
ViewTreeNode* ViewManager::GetNodeById(TransportNodeId id) {
@@ -69,19 +71,14 @@ View* ViewManager::GetViewById(TransportViewId id) {
return it != views_.end() ? it->second : NULL;
}
-void ViewManager::Embed(const String& url, ViewTreeNode* node) {
- synchronizer_->Embed(url, node->id());
-}
-
////////////////////////////////////////////////////////////////////////////////
// ViewManager, private:
ViewManager::ViewManager(
Application* application,
- const base::Callback<void(ViewManager*)> ready_callback)
- : ready_callback_(ready_callback),
- synchronizer_(NULL),
- tree_(NULL) {
+ const base::Callback<void(ViewManager*)>& root_added_callback)
+ : root_added_callback_(root_added_callback),
+ synchronizer_(NULL) {
application->AddService<ViewManagerSynchronizer>(this);
}

Powered by Google App Engine
This is Rietveld 408576698