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

Unified Diff: mojo/services/window_manager/window_manager_app.cc

Issue 433513005: Pass ServiceProvider thru ViewManagerService::Embed() allowing embedder & embeddee to expose servic… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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
« no previous file with comments | « mojo/services/window_manager/window_manager_app.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/window_manager/window_manager_app.cc
diff --git a/mojo/services/window_manager/window_manager_app.cc b/mojo/services/window_manager/window_manager_app.cc
index 699fd0bd6c6ba44c262a885e33b6b34d59a92180..6ed9113ed0857ac992ba6044527bef5f1c4776c4 100644
--- a/mojo/services/window_manager/window_manager_app.cc
+++ b/mojo/services/window_manager/window_manager_app.cc
@@ -150,7 +150,10 @@ bool WindowManagerApp::ConfigureIncomingConnection(
////////////////////////////////////////////////////////////////////////////////
// WindowManagerApp, ViewManagerDelegate implementation:
-void WindowManagerApp::OnEmbed(ViewManager* view_manager, Node* root) {
+void WindowManagerApp::OnEmbed(ViewManager* view_manager,
+ Node* root,
+ ServiceProviderImpl* exported_services,
+ scoped_ptr<ServiceProvider> imported_services) {
DCHECK(!view_manager_ && !root_);
view_manager_ = view_manager;
root_ = root;
@@ -170,8 +173,10 @@ void WindowManagerApp::OnEmbed(ViewManager* view_manager, Node* root) {
focus_client_->AddObserver(this);
activation_client_->AddObserver(this);
- if (wrapped_delegate_)
- wrapped_delegate_->OnEmbed(view_manager, root);
+ if (wrapped_delegate_) {
+ wrapped_delegate_->OnEmbed(view_manager, root, exported_services,
+ imported_services.Pass());
+ }
for (Connections::const_iterator it = connections_.begin();
it != connections_.end(); ++it) {
@@ -184,8 +189,6 @@ void WindowManagerApp::OnViewManagerDisconnected(
DCHECK_EQ(view_manager_, view_manager);
if (wrapped_delegate_)
wrapped_delegate_->OnViewManagerDisconnected(view_manager);
- root_->RemoveObserver(this);
- root_ = NULL;
view_manager_ = NULL;
base::MessageLoop::current()->Quit();
}
@@ -213,6 +216,11 @@ void WindowManagerApp::OnTreeChanged(
}
}
+void WindowManagerApp::OnNodeDestroyed(Node* node) {
+ root_ = NULL;
+ window_tree_host_.reset();
+}
+
////////////////////////////////////////////////////////////////////////////////
// WindowManagerApp, WindowTreeHostMojoDelegate implementation:
« no previous file with comments | « mojo/services/window_manager/window_manager_app.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698