Chromium Code Reviews| Index: ui/base/clipboard/clipboard.h |
| diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h |
| index 40af4df4f2fe2d1568227ee242f4118648c67d53..3a9d30bb136ded54d10926420ff2203c552c7fbe 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,13 @@ 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[]; |
| + static const char kMimeTypeWebkitSmartPaste[]; |
| + static const char kMimeTypePepperCustomData[]; |
| // Platform neutral holder for native data representation of a clipboard type. |
| struct UI_BASE_EXPORT FormatType { |
| @@ -137,6 +142,14 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) { |
| static void SetAllowedThreads( |
| const std::vector<base::PlatformThreadId>& allowed_threads); |
| + // Sets the clipboard for the current thread. Previously, there was only |
| + // 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.) |
|
dcheng
2016/06/04 06:14:00
Is the last part of this comment still accurate?
Elliot Glaysher
2016/06/06 20:10:12
Done.
|
| + static void SetClipboardForCurrentThread( |
| + std::unique_ptr<Clipboard> platform_clipboard); |
| + |
| // Returns the clipboard object for the current thread. |
| // |
| // Most implementations will have at most one clipboard which will live on |
| @@ -310,6 +323,10 @@ class UI_BASE_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) { |
| // For access to WriteObjects(). |
| friend class ScopedClipboardWriter; |
| friend class TestClipboard; |
| + // For SetClipboardForCurrentThread's argument. |
| + friend struct std::default_delete<Clipboard>; |
| + |
| + 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 |