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

Unified Diff: mojo/services/view_manager/view_manager_service_impl.cc

Issue 405163002: Add EmbedRoot to ViewManagerService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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/view_manager/view_manager_service_impl.cc
diff --git a/mojo/services/view_manager/view_manager_service_impl.cc b/mojo/services/view_manager/view_manager_service_impl.cc
index ee2c795001ded8b944f3c016b77010483627373c..96cf1021eabcee262b2b57231782b32b16d08949 100644
--- a/mojo/services/view_manager/view_manager_service_impl.cc
+++ b/mojo/services/view_manager/view_manager_service_impl.cc
@@ -726,6 +726,11 @@ void ViewManagerServiceImpl::SetNodeVisibility(
void ViewManagerServiceImpl::Embed(const String& url,
Id transport_node_id,
const Callback<void(bool)>& callback) {
+ if (NodeIdFromTransportId(transport_node_id) == InvalidNodeId()) {
+ root_node_manager_->EmbedRoot(url);
+ callback.Run(true);
+ return;
+ }
bool success = CanEmbed(transport_node_id);
if (success) {
// Only allow a node to be the root for one connection.
« no previous file with comments | « mojo/services/view_manager/view_manager_service_impl.h ('k') | mojo/services/view_manager/view_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698