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

Unified Diff: services/ui/service.cc

Issue 2339353003: mus: Remove window server access to clipboard and the drag clipboard. (Closed)
Patch Set: Created 4 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 | « services/ui/public/interfaces/clipboard.mojom ('k') | services/ui/ws/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index 26994f49ee2954a65d1f765b80dacfa85080ef36..0c6e222fb84f098a97ac791b5cc33098adb2aaac 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -76,6 +76,7 @@ struct Service::PendingRequest {
};
struct Service::UserState {
+ std::unique_ptr<clipboard::ClipboardImpl> clipboard;
std::unique_ptr<ws::AccessibilityManager> accessibility;
std::unique_ptr<ws::WindowTreeHostFactory> window_tree_host_factory;
};
@@ -269,8 +270,10 @@ void Service::Create(const shell::Identity& remote_identity,
void Service::Create(const shell::Identity& remote_identity,
mojom::ClipboardRequest request) {
- const ws::UserId& user_id = remote_identity.user_id();
- window_server_->GetClipboardForUser(user_id)->AddBinding(std::move(request));
+ UserState* user_state = GetUserState(remote_identity);
+ if (!user_state->clipboard)
+ user_state->clipboard.reset(new clipboard::ClipboardImpl);
+ user_state->clipboard->AddBinding(std::move(request));
}
void Service::Create(const shell::Identity& remote_identity,
« no previous file with comments | « services/ui/public/interfaces/clipboard.mojom ('k') | services/ui/ws/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698