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

Unified Diff: mojo/examples/wm_flow/wm/wm.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/examples/wm_flow/init/init.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/wm_flow/wm/wm.cc
diff --git a/mojo/examples/wm_flow/wm/wm.cc b/mojo/examples/wm_flow/wm/wm.cc
index eb2708a675636c0c4ad6844c1ba23d82c4c98669..5bfa69fcafc92aec59b3acf2b0acd9e623734bab 100644
--- a/mojo/examples/wm_flow/wm/wm.cc
+++ b/mojo/examples/wm_flow/wm/wm.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
@@ -34,8 +35,11 @@ class SimpleWM : public mojo::ApplicationDelegate,
}
// Overridden from mojo::ViewManagerDelegate:
- virtual void OnEmbed(mojo::ViewManager* view_manager,
- mojo::Node* root) MOJO_OVERRIDE {
+ virtual void OnEmbed(
+ mojo::ViewManager* view_manager,
+ mojo::Node* root,
+ mojo::ServiceProviderImpl* exported_services,
+ scoped_ptr<mojo::ServiceProvider> remote_service_provider) MOJO_OVERRIDE {
view_manager_ = view_manager;
root_ = root;
view_manager_->SetWindowManagerDelegate(this);
@@ -52,12 +56,21 @@ class SimpleWM : public mojo::ApplicationDelegate,
}
// Overridden from mojo::WindowManagerDelegate:
- virtual void Embed(const mojo::String& url) MOJO_OVERRIDE {
+ virtual void Embed(
+ const mojo::String& url,
+ mojo::InterfaceRequest<mojo::ServiceProvider> service_provider)
+ MOJO_OVERRIDE {
mojo::Node* embed_node =
mojo::Node::Create(view_manager_);
embed_node->SetBounds(gfx::Rect(next_window_origin_, gfx::Size(400, 400)));
window_container_->AddChild(embed_node);
- embed_node->Embed(url);
+
+ // TODO(beng): We're dropping the |service_provider| passed from the client
+ // on the floor here and passing our own. Seems like we should
+ // be sending both. I'm not yet sure how this sould work for
+ // N levels of proxying.
+ embed_node->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>(
+ new mojo::ServiceProviderImpl).Pass());
next_window_origin_.Offset(50, 50);
}
virtual void DispatchEvent(mojo::View* target,
« no previous file with comments | « mojo/examples/wm_flow/init/init.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698