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

Unified Diff: extensions/common/api/clipboard.idl

Issue 2379573008: Add SetImageData api to chrome.clipboard. (Closed)
Patch Set: Address code review comments and add test cases. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/api/clipboard.idl
diff --git a/extensions/common/api/clipboard.idl b/extensions/common/api/clipboard.idl
index 0b841b09b4a6191b7dba7ec1ede10969b74042f8..a0b72f8e4bedc92eff46d7f247fe99551fa18a82 100644
--- a/extensions/common/api/clipboard.idl
+++ b/extensions/common/api/clipboard.idl
@@ -6,6 +6,9 @@
// access data of the clipboard. This API is currently only implemented for
// ChromeOS.
namespace clipboard {
+ // Image data types:
+ enum ImageType {png, jpeg};
+
interface Events {
// Fired when clipboard data changes.
// Requires clipboard and clipboardRead permissions for adding listener to
@@ -14,4 +17,18 @@ namespace clipboard {
// document.execCommand('paste').
static void onClipboardDataChanged();
};
+
+ callback SetImageDataCallback = void();
+
+ interface Functions {
+ // 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
+ //
+ // |image_data|: The encoded image data.
+ // |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
+ // The callback is called with <code>chrome.runtime.lastError</code>
+ // set to error code if there is an error.
+ static void setImageData(ArrayBuffer image_data,
+ ImageType type,
+ SetImageDataCallback callback);
+ };
};

Powered by Google App Engine
This is Rietveld 408576698