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

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: Fix cast_linux. Created 4 years, 7 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: 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 9954f9ea3dd890a9473fbfd70bf91b1945157539..23f7f2e92b7dda6435724d78919607e92801c223 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"
@@ -109,6 +110,11 @@ WindowManagerConnection::WindowManagerConnection(
screen_.reset(new ScreenMus(this));
screen_->Init(connector);
+ // We keep a weak ptr to clipboard_
dcheng 2016/06/04 06:14:01 Stale comment? I don't see |clipboard_|
+ 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.
@@ -127,6 +133,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();
}
« ui/views/mus/clipboard_unittest.cc ('K') | « 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