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

Unified Diff: components/view_manager/public/interfaces/view_tree.mojom

Issue 1317713006: Changes around how embed roots are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup 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
« no previous file with comments | « components/view_manager/public/cpp/view_tree_connection.h ('k') | components/view_manager/server_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/view_manager/public/interfaces/view_tree.mojom
diff --git a/components/view_manager/public/interfaces/view_tree.mojom b/components/view_manager/public/interfaces/view_tree.mojom
index 008f5dcc031083bc8b26f99df03dac0135cd83c6..891ef02c837611f7a9ad524cd74b38ab2cac164d 100644
--- a/components/view_manager/public/interfaces/view_tree.mojom
+++ b/components/view_manager/public/interfaces/view_tree.mojom
@@ -44,6 +44,16 @@ enum ErrorCode {
//
// The root view is identified with a connection id of 0, and value of 1.
interface ViewTree {
+ const uint32 kAccessPolicyDefault = 0;
Fady Samuel 2015/09/04 16:02:32 Could this be an enum instead?
sky 2015/09/04 16:38:11 As SetAccessPolicy is a bitmask it's a bit mislead
sky 2015/09/04 16:41:44 Actually, it looks like we still support explicit
+ // An embed root has the following abilities:
+ // . The app sees all the descendants of the view the app is ebmedded at, even
+ // those from separate connections.
+ // . The app is able to Embed() in all the descendants of the view the app is
+ // embedded at, even those from separate connections.
+ // Only connections originating from the ViewTreeHostFactory can grant this
+ // policy.
+ const uint32 kAccessPolicyEmbedRoot = 1;
+
// Creates a new view with the specified id. It is up to the client to ensure
// the id is unique to the connection (the id need not be globally unique).
// Additionally the connection id (embedded in |view_id|) must match that of
@@ -113,9 +123,6 @@ interface ViewTree {
// search (pre-order).
GetViewTree(uint32 view_id) => (array<ViewData> views);
- // TODO(sky): rename this and clarify what it does.
- SetEmbedRoot();
-
// A connection may grant access to a view from another connection by way of
// Embed(). Embed() results in a new ViewTreeClient configured with a root of
// |view_id|.
@@ -135,8 +142,7 @@ interface ViewTree {
// When a connection embeds an app the connection no longer has privileges
// to access or see any of the children of the view. If the view had existing
// children the children are removed. The one exception is the root
- // connection and any embed roots. The root always see the full tree, and
- // embed roots see the complete tree at their embed point.
+ // connection and any connections with the policy kAccessPolicyEmbedRoot.
Embed(uint32 view_id, ViewTreeClient client) => (bool success);
SetFocus(uint32 view_id);
@@ -148,6 +154,15 @@ interface ViewTree {
// If state is non-null, the specified view's text input state is updated.
// Otherwise the existing state is used.
SetImeVisibility(uint32 view_id, bool visible, TextInputState? state);
+
+ // Sets the access policy for the next ViewTreeClient embedded in |view_id|.
+ //
+ // Not all connections are allowed to change the access policy. See each
+ // constant for specifics.
+ //
+ // policy_bitmask is a bitmask of the kAccessPolicy constants. See them for
+ // details.
+ SetAccessPolicy(uint32 view_id, uint32 policy_bitmask);
};
// Changes to views are not sent to the connection that originated the
@@ -161,7 +176,8 @@ interface ViewTreeClient {
OnEmbed(uint16 connection_id,
ViewData root,
ViewTree? tree,
- uint32 focused_view);
+ uint32 focused_view,
+ uint32 access_policy);
// Invoked when the application embedded at |view| is disconnected.
OnEmbeddedAppDisconnected(uint32 view);
« no previous file with comments | « components/view_manager/public/cpp/view_tree_connection.h ('k') | components/view_manager/server_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698