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

Unified Diff: services/view_manager/view_manager_service_impl.h

Issue 905083002: Adds Embed() variant to ViewManagerService that takes ViewManagerClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: real comments Created 5 years, 10 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: services/view_manager/view_manager_service_impl.h
diff --git a/services/view_manager/view_manager_service_impl.h b/services/view_manager/view_manager_service_impl.h
index 2008d13d9da2559f03398c571e95193dcb5d0559..a315178d8abccdd3a55536399ee013c28746fc8b 100644
--- a/services/view_manager/view_manager_service_impl.h
+++ b/services/view_manager/view_manager_service_impl.h
@@ -80,10 +80,11 @@ class ViewManagerServiceImpl : public mojo::ViewManagerService,
bool AddView(const ViewId& parent_id, const ViewId& child_id);
std::vector<const ServerView*> GetViewTree(const ViewId& view_id) const;
bool SetViewVisibility(const ViewId& view_id, bool visible);
- bool Embed(const std::string& url,
- const ViewId& view_id,
- mojo::InterfaceRequest<mojo::ServiceProvider> services,
- mojo::ServiceProviderPtr exposed_services);
+ bool EmbedUrl(const std::string& url,
+ const ViewId& view_id,
+ mojo::InterfaceRequest<mojo::ServiceProvider> services,
+ mojo::ServiceProviderPtr exposed_services);
+ bool Embed(const ViewId& view_id, mojo::ViewManagerClientPtr client);
// The following methods are invoked after the corresponding change has been
// processed. They do the appropriate bookkeeping and update the client as
@@ -167,6 +168,8 @@ class ViewManagerServiceImpl : public mojo::ViewManagerService,
// Deletes all Views we own.
void DestroyViews();
+ bool PrepareForEmbed(const ViewId& view_id);
+
// ViewManagerService:
void CreateView(
mojo::Id transport_view_id,
@@ -199,10 +202,13 @@ class ViewManagerServiceImpl : public mojo::ViewManagerService,
const mojo::String& name,
mojo::Array<uint8_t> value,
const mojo::Callback<void(bool)>& callback) override;
- void Embed(const mojo::String& url,
- mojo::Id view_id,
- mojo::InterfaceRequest<mojo::ServiceProvider> services,
- mojo::ServiceProviderPtr exposed_services,
+ void EmbedUrl(const mojo::String& url,
+ mojo::Id transport_view_id,
+ mojo::InterfaceRequest<mojo::ServiceProvider> services,
+ mojo::ServiceProviderPtr exposed_services,
+ const mojo::Callback<void(bool)>& callback) override;
+ void Embed(mojo::Id transport_view_id,
+ mojo::ViewManagerClientPtr client,
const mojo::Callback<void(bool)>& callback) override;
// AccessPolicyDelegate:
@@ -224,6 +230,8 @@ class ViewManagerServiceImpl : public mojo::ViewManagerService,
mojo::ConnectionSpecificId creator_id_;
// The URL of the app that embedded the app this connection was created for.
+ // NOTE: this is empty if the connection was created by way of directly
+ // supplying the ViewManagerClient.
const std::string creator_url_;
mojo::ViewManagerClient* client_;

Powered by Google App Engine
This is Rietveld 408576698