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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 module mojo {
6
7 interface Clipboard {
8 enum Type {
9 COPY_PASTE,
10 SELECTION,
11 DRAG
12 };
13
14 // Mime type constants
15 const string MIME_TYPE_TEXT = "text/plain";
16 const string MIME_TYPE_HTML = "text/html";
17
18 // Returns a sequence number which uniquely identifies clipboard state.
19 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
20
21 // Returns the available mime types. (Note: the chrome interface has a
22 // |contains_filenames| parameter here, but it appears to always be set
23 // to false.)
24 GetAvailableFormatMimeTypes(Type clipboard_types) => (string[] types);
25
26 ReadPlainText(Type clipboard_type) => (string text);
27 ReadHTML(Type clipboard_type) =>
28 (string html, string url, uint32 fragment_start, uint32 fragment_end);
29 ReadMIMEType(Type clipboard_type, string mime_type) => (string data);
30 // TODO: We probably want an image type.
31
32 // Clipboard Writing
33 //
34 // Clipboard writing is a two phase operation, where a client queues all data
35 // types that they want written to the clipboard, and then writes all queued
36 // data in one pass. We do this to prevent racing with other applications on
37 // the system.
38
39 // Queue writing individual datatypes to specific clipboards.
40 QueueWritePlainText(Type clipboard_type, string text);
41 QueueWriteHTML(Type clipboard_type, string html_text, string url);
42 QueueWriteMIMEType(Type clipboard_type, string mime_type, string data);
43 // TODO: We probably want an image type.
44
45 // Writes all queued data types in one pass.
46 WriteQueuedData(Type clipboard_type);
47 };
48
49 } // module mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698