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

Unified Diff: mojo/services/public/interfaces/clipboard/clipboard.mojom

Issue 562483002: mojo: Create a basic clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ;_; Created 6 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
Index: mojo/services/public/interfaces/clipboard/clipboard.mojom
diff --git a/mojo/services/public/interfaces/clipboard/clipboard.mojom b/mojo/services/public/interfaces/clipboard/clipboard.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..74fc2723d978c6b7619df15bbf1373c2236002c5
--- /dev/null
+++ b/mojo/services/public/interfaces/clipboard/clipboard.mojom
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module mojo {
+
+interface Clipboard {
+ enum Type {
+ COPY_PASTE,
+ SELECTION,
+ DRAG
+ };
+
+ // Mime type constants
+ const string MIME_TYPE_TEXT = "text/plain";
+ const string MIME_TYPE_HTML = "text/html";
+
+ // Returns a sequence number which uniquely identifies clipboard state.
+ GetSequenceNumber(Type clipboard_type) => (uint64 sequence);
sky 2014/09/11 19:52:39 Does sequence really need to be uint64? I'm not su
dcheng 2014/09/11 20:06:21 This is used inside Blink to prevent a malicious s
Elliot Glaysher 2014/09/11 21:42:28 I've added to this comment that sequence numbers a
+
+ // Returns the available mime types. (Note: the chrome interface has a
+ // |contains_filenames| parameter here, but it appears to always be set
+ // to false.)
+ GetAvailableFormatMimeTypes(Type clipboard_types) => (string[] types);
+
+ ReadPlainText(Type clipboard_type) => (string text);
+ ReadHTML(Type clipboard_type) =>
+ (string html, string url, uint32 fragment_start, uint32 fragment_end);
+ ReadMIMEType(Type clipboard_type, string mime_type) => (string data);
+ // TODO: We probably want an image type.
+
+ // Clipboard Writing
+ //
+ // Clipboard writing is a two phase operation, where a client queues all data
+ // types that they want written to the clipboard, and then writes all queued
+ // data in one pass. We do this to prevent racing with other applications on
+ // the system.
+
+ // Queue writing individual datatypes to specific clipboards.
+ QueueWritePlainText(Type clipboard_type, string text);
+ QueueWriteHTML(Type clipboard_type, string html_text, string url);
+ QueueWriteMIMEType(Type clipboard_type, string mime_type, string data);
+ // TODO: We probably want an image type.
+
+ // Writes all queued data types in one pass.
+ WriteQueuedData(Type clipboard_type);
+};
+
+} // module mojo

Powered by Google App Engine
This is Rietveld 408576698