Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 is a temporary solution for | 6 // access data of the clipboard. This is a temporary solution for |
| 7 // chromeos platform apps until open-web alternative is available. It will be | 7 // chromeos platform apps until open-web alternative is available. It will be |
| 8 // deprecated once open-web solution is available, which could be in 2017 Q2. | 8 // deprecated once open-web solution is available, which could be in 2017 Q2. |
|
Devlin
2017/04/26 18:20:15
Any update on this?
jennyz
2017/05/16 18:22:03
I will ask dcheng@ for update, he is OOO until May
Devlin
2017/05/17 16:08:43
Past May 2 :)
dcheng
2017/05/19 13:05:09
garykac@ is working on landing the IDL changes for
jennyz
2017/05/19 22:53:12
I will sync with garykac@, thanks!
jennyz
2017/05/22 23:59:09
Done.
jennyz
2017/05/22 23:59:09
Done.
| |
| 9 [platforms=("chromeos"), | 9 [platforms=("chromeos"), |
| 10 implemented_in="extensions/browser/api/clipboard/clipboard_api.h"] | 10 implemented_in="extensions/browser/api/clipboard/clipboard_api.h"] |
| 11 namespace clipboard { | 11 namespace clipboard { |
| 12 // Supported image types. | 12 // Supported image types. |
| 13 enum ImageType {png, jpeg}; | 13 enum ImageType {png, jpeg}; |
| 14 | |
| 15 // Additional data item to be added along with the |image_data| to describe | |
| 16 // the |image_data|. | |
| 17 dictionary AdditionalDataItem { | |
| 18 // MIME type of the additional data item, supported types are: | |
| 19 // "text/plain" and "text/html". | |
|
Devlin
2017/04/26 18:20:15
if these are the only allowed types, why not an en
jennyz
2017/05/16 18:22:03
Done.
| |
| 20 DOMString type; | |
| 21 | |
| 22 // Content of the additional data item. Either the plain text string if | |
| 23 // |type| is "text/plain" or markup string if |type| is "text/html". | |
| 24 DOMString data; | |
|
Devlin
2017/04/26 18:20:15
From the implementation, I see that this has a lim
jennyz
2017/05/16 18:22:03
Done.
| |
| 25 }; | |
| 14 | 26 |
| 15 interface Events { | 27 interface Events { |
| 16 // Fired when clipboard data changes. | 28 // Fired when clipboard data changes. |
| 17 // Requires clipboard and clipboardRead permissions for adding listener to | 29 // Requires clipboard and clipboardRead permissions for adding listener to |
| 18 // chrome.clipboard.onClipboardDataChanged event. | 30 // chrome.clipboard.onClipboardDataChanged event. |
| 19 // After this event fires, the clipboard data is available by calling | 31 // After this event fires, the clipboard data is available by calling |
| 20 // document.execCommand('paste'). | 32 // document.execCommand('paste'). |
| 21 static void onClipboardDataChanged(); | 33 static void onClipboardDataChanged(); |
| 22 }; | 34 }; |
| 23 | 35 |
| 24 callback SetImageDataCallback = void(); | 36 callback SetImageDataCallback = void(); |
| 25 | 37 |
| 26 interface Functions { | 38 interface Functions { |
| 27 // Sets image data to clipboard. | 39 // Sets image data to clipboard. |
| 28 // | 40 // |
| 29 // |image_data|: The encoded image data. | 41 // |image_data|: The encoded image data. |
| 30 // |type|: The type of image being passed. | 42 // |type|: The type of image being passed. |
| 43 // |additional_items|: Additional data items for describing image data. | |
| 31 // The callback is called with <code>chrome.runtime.lastError</code> | 44 // The callback is called with <code>chrome.runtime.lastError</code> |
| 32 // set to error code if there is an error. | 45 // set to error code if there is an error. |
| 33 // Requires clipboard and clipboardWrite permissions. | 46 // Requires clipboard and clipboardWrite permissions. |
| 34 static void setImageData(ArrayBuffer image_data, | 47 static void setImageData(ArrayBuffer image_data, |
| 35 ImageType type, | 48 ImageType type, |
| 49 AdditionalDataItem[] additional_items, | |
|
Devlin
2017/04/26 18:20:15
This is not a backwards compatible change, and wil
jennyz
2017/05/16 18:22:03
Mark the new parameter as optional.
| |
| 36 SetImageDataCallback callback); | 50 SetImageDataCallback callback); |
| 37 }; | 51 }; |
| 38 }; | 52 }; |
| OLD | NEW |