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

Side by Side Diff: extensions/common/api/clipboard.idl

Issue 2837983002: Modify SetImageData to add additional items along with image data to save on clipboard. (Closed)
Patch Set: Make additional data items parameter optional and address other comments. Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
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.
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 14
15 enum DataItemType {text_plain, text_html};
Devlin 2017/05/17 16:08:44 prefer jsCasing
jennyz 2017/05/18 23:33:49 Done.
16
17 // Additional data item to be added along with the |image_data| to describe
18 // the |image_data|.
19 dictionary AdditionalDataItem {
20 // MIME type of the additional data item, supported types are:
Devlin 2017/05/17 16:08:44 "supported types" portion of this comment is out-d
jennyz 2017/05/18 23:33:49 Done.
21 // "text/plain" and "text/html".
22 DataItemType type;
23
24 // Content of the additional data item. Either the plain text string if
25 // |type| is "text/plain" or markup string if |type| is "text/html". The
26 // data can not exceed 2MB characters.
Devlin 2017/05/17 16:08:44 "2MB characters" doesn't make sense to me. We sho
jennyz 2017/05/18 23:33:49 Done.
27 DOMString data;
28 };
29
15 interface Events { 30 interface Events {
16 // Fired when clipboard data changes. 31 // Fired when clipboard data changes.
17 // Requires clipboard and clipboardRead permissions for adding listener to 32 // Requires clipboard and clipboardRead permissions for adding listener to
18 // chrome.clipboard.onClipboardDataChanged event. 33 // chrome.clipboard.onClipboardDataChanged event.
19 // After this event fires, the clipboard data is available by calling 34 // After this event fires, the clipboard data is available by calling
20 // document.execCommand('paste'). 35 // document.execCommand('paste').
21 static void onClipboardDataChanged(); 36 static void onClipboardDataChanged();
22 }; 37 };
23 38
24 callback SetImageDataCallback = void(); 39 callback SetImageDataCallback = void();
25 40
26 interface Functions { 41 interface Functions {
27 // Sets image data to clipboard. 42 // Sets image data to clipboard.
28 // 43 //
29 // |image_data|: The encoded image data. 44 // |image_data|: The encoded image data.
30 // |type|: The type of image being passed. 45 // |type|: The type of image being passed.
46 // |additional_items|: Additional data items for describing image data.
31 // The callback is called with <code>chrome.runtime.lastError</code> 47 // The callback is called with <code>chrome.runtime.lastError</code>
32 // set to error code if there is an error. 48 // set to error code if there is an error.
33 // Requires clipboard and clipboardWrite permissions. 49 // Requires clipboard and clipboardWrite permissions.
34 static void setImageData(ArrayBuffer image_data, 50 static void setImageData(ArrayBuffer image_data,
35 ImageType type, 51 ImageType type,
52 optional AdditionalDataItem[] additional_items,
Devlin 2017/05/17 16:08:44 jsStyle
jennyz 2017/05/18 23:33:49 Done.
36 SetImageDataCallback callback); 53 SetImageDataCallback callback);
37 }; 54 };
38 }; 55 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698