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

Unified Diff: ui/base/clipboard/clipboard.h

Issue 2011833003: Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch cleanup. 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/base/clipboard/clipboard.h
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
index 40af4df4f2fe2d1568227ee242f4118648c67d53..36ebe582d0d7455ed44524867385c59d4f1ce600 100644
--- a/ui/base/clipboard/clipboard.h
+++ b/ui/base/clipboard/clipboard.h
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <string>
#include <vector>
@@ -60,9 +61,11 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
static const char kMimeTypeText[];
static const char kMimeTypeURIList[];
static const char kMimeTypeDownloadURL[];
+ static const char kMimeTypeMozillaURL[];
static const char kMimeTypeHTML[];
static const char kMimeTypeRTF[];
static const char kMimeTypePNG[];
+ static const char kMimeTypeWebCustomData[];
sky 2016/05/26 23:10:27 Move over todo about removal?
Elliot Glaysher 2016/05/31 17:01:40 The bug is closed and archived.
// Platform neutral holder for native data representation of a clipboard type.
struct UI_BASE_EXPORT FormatType {
@@ -137,6 +140,13 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
static void SetAllowedThreads(
const std::vector<base::PlatformThreadId>& allowed_threads);
+ // Builds the clipboard for the current thread. Previously, there was only
sky 2016/05/26 23:10:27 This comment is a bit confusing. It's not building
+ // one clipboard implementation on a platform; now that mus exists, during
+ // mus app startup, we need to specifically initialize mus instead of the
+ // current platform clipboard. We take ownership of |platform_clipboard|. (We
+ // can't use unique_ptr since we don't want to expose the destructor.)
sky 2016/05/26 23:10:27 Have this class friend unique_ptr? Alternatively t
Elliot Glaysher 2016/05/31 17:01:40 Done.
+ static void SetClipboardForCurrentThread(Clipboard* platform_clipboard);
+
// Returns the clipboard object for the current thread.
//
// Most implementations will have at most one clipboard which will live on
@@ -311,6 +321,8 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
friend class ScopedClipboardWriter;
friend class TestClipboard;
+ static base::PlatformThreadId GetAndValidateThreadID();
+
// A list of allowed threads. By default, this is empty and no thread checking
// is done (in the unit test case), but a user (like content) can set which
// threads are allowed to call this method.

Powered by Google App Engine
This is Rietveld 408576698