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 is a temporary solution for |
7 // ChromeOS. | 7 // chromeos platform apps until open-web alternative is available. It will be |
Devlin
2016/12/16 02:26:16
links to the open web alternative planning stage?
jennyz
2016/12/19 07:01:36
I am asking dcheng to help me find the document ab
jennyz
2016/12/20 19:24:08
According to chrome team(Gary), they are going to
| |
8 // deprecated once open-web solution is available. | |
9 [platforms=("chromeos"), | |
10 implemented_in="extensions/browser/api/clipboard/clipboard_api.h"] | |
8 namespace clipboard { | 11 namespace clipboard { |
12 // Supported image types. | |
13 enum ImageType {png, jpeg}; | |
14 | |
9 interface Events { | 15 interface Events { |
10 // Fired when clipboard data changes. | 16 // Fired when clipboard data changes. |
11 // Requires clipboard and clipboardRead permissions for adding listener to | 17 // Requires clipboard and clipboardRead permissions for adding listener to |
12 // chrome.clipboard.onClipboardDataChanged event. | 18 // chrome.clipboard.onClipboardDataChanged event. |
13 // After this event fires, the clipboard data is available by calling | 19 // After this event fires, the clipboard data is available by calling |
14 // document.execCommand('paste'). | 20 // document.execCommand('paste'). |
15 static void onClipboardDataChanged(); | 21 static void onClipboardDataChanged(); |
16 }; | 22 }; |
23 | |
24 callback SetImageDataCallback = void(); | |
25 | |
26 interface Functions { | |
27 // Sets image data to clipboard. | |
28 // | |
29 // |image_data|: The encoded image data. | |
30 // |type|: Type of |image_data|. | |
Devlin
2016/12/16 02:26:16
instead of saying "Type of |image_data|", let's sa
jennyz
2016/12/19 07:01:36
Done.
| |
31 // The callback is called with <code>chrome.runtime.lastError</code> | |
32 // set to error code if there is an error. | |
33 static void setImageData(ArrayBuffer image_data, | |
34 ImageType type, | |
35 SetImageDataCallback callback); | |
36 }; | |
17 }; | 37 }; |
OLD | NEW |