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

Unified Diff: components/mus/ws/window_tree.cc

Issue 1782123003: Makes WindowTree take the AccessPolicy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 9 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/mus/ws/window_tree.h ('k') | components/mus/ws/window_tree_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 58c0f282774bf84d7ea7d7e35b798411a4c6c0be..34e0ed582ba03312025a1a1923c7183e378db34e 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -19,7 +19,6 @@
#include "components/mus/ws/platform_display.h"
#include "components/mus/ws/server_window.h"
#include "components/mus/ws/server_window_observer.h"
-#include "components/mus/ws/window_manager_access_policy.h"
#include "components/mus/ws/window_manager_state.h"
#include "components/mus/ws/window_tree_binding.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
@@ -67,20 +66,18 @@ class TargetedEvent : public ServerWindowObserver {
WindowTree::WindowTree(ConnectionManager* connection_manager,
const UserId& user_id,
- ServerWindow* root)
+ ServerWindow* root,
+ scoped_ptr<AccessPolicy> access_policy)
: connection_manager_(connection_manager),
user_id_(user_id),
id_(connection_manager_->GetAndAdvanceNextConnectionId()),
next_window_id_(1),
+ access_policy_(std::move(access_policy)),
event_ack_id_(0),
window_manager_internal_(nullptr) {
if (root)
roots_.insert(root);
- // TODO(sky): pass in type rather than inferring it.
- if (root && root->id().connection_id == kInvalidConnectionId)
- access_policy_.reset(new WindowManagerAccessPolicy(id_, this));
- else
- access_policy_.reset(new DefaultAccessPolicy(id_, this));
+ access_policy_->Init(id_, this);
}
WindowTree::~WindowTree() {
@@ -279,8 +276,8 @@ bool WindowTree::Embed(const ClientWindowId& window_id,
PrepareForEmbed(window);
// When embedding we don't know the user id of where the TreeClient came
// from. Use an invalid id, which limits what the client is able to do.
- connection_manager_->EmbedAtWindow(window, InvalidUserId(),
- std::move(client));
+ connection_manager_->EmbedAtWindow(window, InvalidUserId(), std::move(client),
+ make_scoped_ptr(new DefaultAccessPolicy));
return true;
}
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | components/mus/ws/window_tree_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698