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

Unified Diff: ui/views/mus/window_manager_connection.cc

Issue 2011833003: Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static in test by creating forwarding clipboard subclass. Created 4 years, 6 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 | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/window_manager_connection.cc
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc
index f17c0aa96379af0e4f4211482041711d4505c760..80770cf04466a315c097c9a69d19a519a7f768bb 100644
--- a/ui/views/mus/window_manager_connection.cc
+++ b/ui/views/mus/window_manager_connection.cc
@@ -17,6 +17,7 @@
#include "services/shell/public/cpp/connection.h"
#include "services/shell/public/cpp/connector.h"
#include "ui/events/devices/device_data_manager.h"
+#include "ui/views/mus/clipboard_mus.h"
#include "ui/views/mus/native_widget_mus.h"
#include "ui/views/mus/screen_mus.h"
#include "ui/views/pointer_watcher.h"
@@ -114,6 +115,10 @@ WindowManagerConnection::WindowManagerConnection(
screen_.reset(new ScreenMus(this));
screen_->Init(connector);
+ std::unique_ptr<ClipboardMus> clipboard(new ClipboardMus);
+ clipboard->Init(connector);
+ ui::Clipboard::SetClipboardForCurrentThread(std::move(clipboard));
+
if (!ui::DeviceDataManager::HasInstance()) {
// TODO(sad): We should have a DeviceDataManager implementation that talks
// to a mojo service to learn about the input-devices on the system.
@@ -132,6 +137,7 @@ WindowManagerConnection::~WindowManagerConnection() {
// ~WindowTreeClient calls back to us (we're its delegate), destroy it while
// we are still valid.
client_.reset();
+ ui::Clipboard::DestroyClipboardForCurrentThread();
if (created_device_data_manager_)
ui::DeviceDataManager::DeleteInstance();
« no previous file with comments | « ui/views/mus/window_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698