OLD | NEW |
---|---|
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The <code>chrome.clipboard</code> API is provided to allow users to | 5 // The <code>chrome.clipboard</code> API is provided to allow users to |
6 // access data of the clipboard. This API is currently only implemented for | 6 // access data of the clipboard. This API is currently only implemented for |
7 // ChromeOS. | 7 // ChromeOS. |
8 namespace clipboard { | 8 namespace clipboard { |
9 // Image data types: | |
10 enum ImageType {png, jpeg}; | |
11 | |
9 interface Events { | 12 interface Events { |
10 // Fired when clipboard data changes. | 13 // Fired when clipboard data changes. |
11 // Requires clipboard and clipboardRead permissions for adding listener to | 14 // Requires clipboard and clipboardRead permissions for adding listener to |
12 // chrome.clipboard.onClipboardDataChanged event. | 15 // chrome.clipboard.onClipboardDataChanged event. |
13 // After this event fires, the clipboard data is available by calling | 16 // After this event fires, the clipboard data is available by calling |
14 // document.execCommand('paste'). | 17 // document.execCommand('paste'). |
15 static void onClipboardDataChanged(); | 18 static void onClipboardDataChanged(); |
16 }; | 19 }; |
20 | |
21 callback SetImageDataCallback = void(); | |
22 | |
23 interface Functions { | |
24 // Sets image data to clipboard. | |
Devlin
2016/12/09 15:23:54
Doesn't it also return the result?
jennyz
2016/12/14 01:15:36
Now I used chrome.runtime.lastError to pass the er
| |
25 // | |
26 // |image_data|: The encoded image data. | |
27 // |type|: The image type, the supported types are: "png", "jpeg". | |
Devlin
2016/12/09 15:23:54
The documentation will include a link (or inlining
jennyz
2016/12/14 01:15:36
I update the comment here, but I am not exactly su
| |
28 // The callback is called with <code>chrome.runtime.lastError</code> | |
29 // set to error code if there is an error. | |
30 static void setImageData(ArrayBuffer image_data, | |
31 ImageType type, | |
32 SetImageDataCallback callback); | |
33 }; | |
17 }; | 34 }; |
OLD | NEW |