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

Unified Diff: components/view_manager/public/cpp/lib/view_tree_client_impl.cc

Issue 1317713006: Changes around how embed roots are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 5 years, 3 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: components/view_manager/public/cpp/lib/view_tree_client_impl.cc
diff --git a/components/view_manager/public/cpp/lib/view_tree_client_impl.cc b/components/view_manager/public/cpp/lib/view_tree_client_impl.cc
index 216f16bd4cdaedc7a139ee81d017d56557a7011b..2c02e069f8be70dca81953b92ccdbf0dd64d5bc0 100644
--- a/components/view_manager/public/cpp/lib/view_tree_client_impl.cc
+++ b/components/view_manager/public/cpp/lib/view_tree_client_impl.cc
@@ -182,6 +182,11 @@ void ViewTreeClientImpl::SetImeVisibility(Id view_id,
tree_->SetImeVisibility(view_id, visible, state.Pass());
}
+void ViewTreeClientImpl::SetAccessPolicy(Id view_id, uint32_t access_policy) {
+ DCHECK(tree_);
+ tree_->SetAccessPolicy(view_id, access_policy);
+}
+
void ViewTreeClientImpl::Embed(Id view_id, ViewTreeClientPtr client) {
DCHECK(tree_);
tree_->Embed(view_id, client.Pass(), ActionCompletedCallback());
@@ -248,10 +253,8 @@ View* ViewTreeClientImpl::CreateView() {
return view;
}
-void ViewTreeClientImpl::SetEmbedRoot() {
- // TODO(sky): this isn't right. The server may ignore the call.
- is_embed_root_ = true;
- tree_->SetEmbedRoot();
+bool ViewTreeClientImpl::IsEmbedRoot() {
+ return is_embed_root_;
}
////////////////////////////////////////////////////////////////////////////////
@@ -260,13 +263,16 @@ void ViewTreeClientImpl::SetEmbedRoot() {
void ViewTreeClientImpl::OnEmbed(ConnectionSpecificId connection_id,
ViewDataPtr root_data,
ViewTreePtr tree,
- Id focused_view_id) {
+ Id focused_view_id,
+ uint32 access_policy) {
if (tree) {
DCHECK(!tree_);
tree_ = tree.Pass();
tree_.set_connection_error_handler([this]() { delete this; });
}
connection_id_ = connection_id;
+ is_embed_root_ =
+ (access_policy & mojo::ViewTree::ACCESS_POLICY_EMBED_ROOT) != 0;
DCHECK(!root_);
root_ = AddViewToConnection(this, nullptr, root_data);
« no previous file with comments | « components/view_manager/public/cpp/lib/view_tree_client_impl.h ('k') | components/view_manager/public/cpp/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698