Chromium Code Reviews| 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(boolean success); | |
| 22 | |
| 23 interface Functions { | |
| 24 // Sets image data to clipboard. | |
| 25 // | |
| 26 // |image_data|: The encoded image data. | |
| 27 // |type|: The image type, the supported types are: "png", "jpeg". | |
| 28 static void setImageData(ArrayBuffer image_data, | |
| 29 ImageType type, | |
| 30 SetImageDataCallback callback); | |
|
Devlin
2016/11/16 02:34:33
Why a boolean success callback? In which circumst
jennyz
2016/12/07 01:21:48
Removed the boolean argument and pass error with c
| |
| 31 }; | |
| 17 }; | 32 }; |
| OLD | NEW |