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

Issue 2379573008: Add SetImageData api to chrome.clipboard. (Closed)

Created:
4 years, 2 months ago by jennyz
Modified:
3 years, 11 months ago
Reviewers:
Devlin, dcheng, meacer
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, asvitkine+watch_chromium.org, dcheng, extensions-reviews_chromium.org, garykac
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add SetImageData api to chrome.clipboard extension to allow js script to pass the png or jpeg encoded image data in ArrayBuffer to be written on chromeos clipboard. BUG=678794 TBR=isherman Committed: https://crrev.com/6298fc54177c7f2919fc158a3b43e7a3e08f36fe Cr-Commit-Position: refs/heads/master@{#441546}

Patch Set 1 #

Patch Set 2 : Add a string for prompting clipboard write permission for installing chrome.clipboard. #

Total comments: 8

Patch Set 3 : Change ImageType to enum data type in SetImageData API. #

Patch Set 4 : Add clipboardReadWrite permission. #

Patch Set 5 : Fix compiler error. #

Patch Set 6 : Fix interactive_ui_tests issue. #

Total comments: 46

Patch Set 7 : Address code review comments and add test cases. #

Total comments: 45

Patch Set 8 : More changes for addressing code review comments. #

Patch Set 9 : Rebase. #

Patch Set 10 : Fix compiler issue on non-chromeos platforms. #

Patch Set 11 : Fix compiler errors. #

Patch Set 12 : Add a warning in clipboard.idl about the future deprecation plan. #

Total comments: 27

Patch Set 13 : More improvements from code review comments. #

Patch Set 14 : Rebase. #

Patch Set 15 : Defer creating clipboard_extension_helper_ object until used. #

Patch Set 16 : Remove previously added image files. #

Patch Set 17 : Update idl for possible web alternative timeline. #

Total comments: 12

Patch Set 18 : Remvoe clipboardReadWrite permission, etc. #

Patch Set 19 : Adjust clipboard api permissions to method level, etc. #

Total comments: 10

Patch Set 20 : Change permission strings and fix nits. #

Total comments: 4

Patch Set 21 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+431 lines, -9 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/browser/extensions/clipboard_extension_helper_chromeos.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/browser/extensions/clipboard_extension_helper_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +119 lines, -0 lines 0 comments Download
M chrome/browser/extensions/permission_message_combinations_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/common/extensions/permissions/chrome_permission_message_rules.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/common/extensions/permissions/permission_set_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/set_image_data/app_main.html View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/set_image_data/main.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/set_image_data/manifest.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +17 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +56 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/redirect_target.gif View 1 2 3 4 5 6 7 Binary file 0 comments Download
A chrome/test/data/extensions/test.jpg View 1 2 3 4 5 6 7 Binary file 0 comments Download
M extensions/browser/api/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +1 line, -1 line 0 comments Download
M extensions/browser/api/clipboard/clipboard_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +13 lines, -0 lines 0 comments Download
M extensions/browser/api/clipboard/clipboard_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +23 lines, -1 line 0 comments Download
M extensions/browser/api/extensions_api_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -0 lines 0 comments Download
M extensions/browser/api/extensions_api_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -0 lines 0 comments Download
M extensions/browser/browser_context_keyed_service_factories.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/api/_api_features.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +8 lines, -2 lines 0 comments Download
M extensions/common/api/clipboard.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +24 lines, -3 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 71 (14 generated)
jennyz
Hi Daniel, This cl implements an extension API setImageData in chrome.clipboard, that can accepts png ...
4 years, 2 months ago (2016-09-30 21:49:08 UTC) #3
jennyz
4 years, 2 months ago (2016-10-03 22:54:59 UTC) #5
dcheng
Also, I am not sure how widely we want to expose this, since it would ...
4 years, 2 months ago (2016-10-04 05:13:28 UTC) #6
Devlin
Did this ever go through an API review?
4 years, 2 months ago (2016-10-04 16:26:33 UTC) #7
jennyz
On 2016/10/04 16:26:33, Devlin wrote: > Did this ever go through an API review? What ...
4 years, 2 months ago (2016-10-04 17:13:47 UTC) #8
jennyz
On 2016/10/04 05:13:28, dcheng wrote: > Also, I am not sure how widely we want ...
4 years, 2 months ago (2016-10-04 18:35:55 UTC) #9
jennyz
https://codereview.chromium.org/2379573008/diff/20001/chrome/browser/extensions/clipboard_extension_helper.cc File chrome/browser/extensions/clipboard_extension_helper.cc (right): https://codereview.chromium.org/2379573008/diff/20001/chrome/browser/extensions/clipboard_extension_helper.cc#newcode41 chrome/browser/extensions/clipboard_extension_helper.cc:41: ImageDecoder::StartWithOptions(this, image_data_str, codec, true); On 2016/10/04 05:13:27, dcheng wrote: ...
4 years, 2 months ago (2016-10-04 23:53:54 UTC) #10
jennyz
On 2016/10/04 16:26:33, Devlin wrote: > Did this ever go through an API review? This ...
4 years, 2 months ago (2016-10-11 17:53:48 UTC) #11
Devlin
On 2016/10/11 17:53:48, jennyz wrote: > On 2016/10/04 16:26:33, Devlin wrote: > > Did this ...
4 years, 2 months ago (2016-10-12 21:14:15 UTC) #12
jennyz
On 2016/10/12 21:14:15, Devlin wrote: > On 2016/10/11 17:53:48, jennyz wrote: > > On 2016/10/04 ...
4 years, 2 months ago (2016-10-12 23:20:20 UTC) #13
jennyz
I made some changes to the cl, the major change I made is too add ...
4 years, 1 month ago (2016-11-09 01:02:27 UTC) #14
jennyz
devlin@, I have talked to dcheng, he is fine with the cl, and will bless ...
4 years, 1 month ago (2016-11-16 00:41:04 UTC) #15
Devlin
On 2016/11/16 00:41:04, jennyz wrote: > devlin@, I have talked to dcheng, he is fine ...
4 years, 1 month ago (2016-11-16 02:23:23 UTC) #16
Devlin
Two additional high-level comments: - This needs tests - From the API proposal, it was ...
4 years, 1 month ago (2016-11-16 02:34:33 UTC) #18
dcheng
I think it's a bit confusing that we now have four different clipboard permissions (and ...
4 years, 1 month ago (2016-11-17 01:13:32 UTC) #19
Devlin
https://codereview.chromium.org/2379573008/diff/100001/extensions/browser/extensions_browser_client.h File extensions/browser/extensions_browser_client.h (right): https://codereview.chromium.org/2379573008/diff/100001/extensions/browser/extensions_browser_client.h#newcode230 extensions/browser/extensions_browser_client.h:230: virtual void SaveImageDataToClipboard( On 2016/11/17 01:13:32, dcheng wrote: > ...
4 years, 1 month ago (2016-11-17 01:25:34 UTC) #20
jennyz
I added the test code and updated the patch addressing the comments. Please take another ...
4 years ago (2016-12-07 01:21:48 UTC) #21
Devlin
On 2016/11/16 02:34:33, Devlin (in MON - PST plus 3) wrote: > - From the ...
4 years ago (2016-12-09 15:23:55 UTC) #22
jennyz
https://codereview.chromium.org/2379573008/diff/100001/chrome/browser/extensions/clipboard_extension_helper.cc File chrome/browser/extensions/clipboard_extension_helper.cc (right): https://codereview.chromium.org/2379573008/diff/100001/chrome/browser/extensions/clipboard_extension_helper.cc#newcode90 chrome/browser/extensions/clipboard_extension_helper.cc:90: clipboard_image_data_decoder_ = new ClipboardImageDataDecoder(this); On 2016/11/17 01:13:32, dcheng wrote: ...
4 years ago (2016-12-14 01:15:36 UTC) #23
jennyz
4 years ago (2016-12-14 17:57:08 UTC) #24
Devlin
It seems like we still haven't addressed one of my original questions from ~4 weeks ...
4 years ago (2016-12-15 00:10:44 UTC) #25
jennyz
On 2016/12/15 00:10:44, Devlin wrote: > It seems like we still haven't addressed one of ...
4 years ago (2016-12-15 06:11:36 UTC) #26
Devlin
On 2016/12/15 06:11:36, jennyz wrote: > On 2016/12/15 00:10:44, Devlin wrote: > > It seems ...
4 years ago (2016-12-15 17:19:59 UTC) #27
Devlin
On 2016/12/15 17:19:59, Devlin wrote: > On 2016/12/15 06:11:36, jennyz wrote: > > On 2016/12/15 ...
4 years ago (2016-12-15 17:20:39 UTC) #28
jennyz
On 2016/12/15 17:20:39, Devlin wrote: > On 2016/12/15 17:19:59, Devlin wrote: > > On 2016/12/15 ...
4 years ago (2016-12-15 19:04:45 UTC) #29
jennyz
4 years ago (2016-12-15 19:04:54 UTC) #30
Devlin
https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json#newcode153 chrome/common/extensions/api/_permission_features.json:153: "clipboardReadWrite": { On 2016/12/09 15:23:43, Devlin wrote: > On ...
4 years ago (2016-12-16 02:05:08 UTC) #31
Devlin
https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc File chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc (right): https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc#newcode21 chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc:21: IN_PROC_BROWSER_TEST_F(ClipboardExtensionApiTest, SetImageData) { On 2016/12/14 01:15:35, jennyz wrote: > ...
4 years ago (2016-12-16 02:26:16 UTC) #32
jennyz
https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc File chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc (right): https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc#newcode21 chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc:21: IN_PROC_BROWSER_TEST_F(ClipboardExtensionApiTest, SetImageData) { On 2016/12/16 02:26:15, Devlin wrote: > ...
4 years ago (2016-12-19 07:01:36 UTC) #33
jennyz
On 2016/12/19 07:01:36, jennyz wrote: > https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc > File chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc (right): > > https://codereview.chromium.org/2379573008/diff/120001/chrome/browser/extensions/clipboard_extension_apitest_chromeos.cc#newcode21 > ...
4 years ago (2016-12-19 22:44:16 UTC) #34
Devlin
https://codereview.chromium.org/2379573008/diff/120001/chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js File chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js (right): https://codereview.chromium.org/2379573008/diff/120001/chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js#newcode43 chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js:43: testSetImageDataClipboard(baseUrl + '/penguin.png', 'png', true); On 2016/12/19 07:01:36, jennyz ...
4 years ago (2016-12-19 23:08:23 UTC) #35
jennyz
On 2016/12/19 23:08:23, Devlin wrote: > https://codereview.chromium.org/2379573008/diff/120001/chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js > File chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js > (right): > > https://codereview.chromium.org/2379573008/diff/120001/chrome/test/data/extensions/api_test/clipboard/set_image_data/test.js#newcode43 ...
4 years ago (2016-12-19 23:21:22 UTC) #36
jennyz
4 years ago (2016-12-19 23:22:17 UTC) #37
jennyz
https://codereview.chromium.org/2379573008/diff/220001/extensions/common/api/clipboard.idl File extensions/common/api/clipboard.idl (right): https://codereview.chromium.org/2379573008/diff/220001/extensions/common/api/clipboard.idl#newcode7 extensions/common/api/clipboard.idl:7: // chromeos platform apps until open-web alternative is available. ...
4 years ago (2016-12-20 19:24:09 UTC) #38
Devlin
https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json#newcode153 chrome/common/extensions/api/_permission_features.json:153: "clipboardReadWrite": { On 2016/12/16 02:05:08, Devlin wrote: > On ...
4 years ago (2016-12-20 21:25:02 UTC) #39
jennyz
Since there are several patches and comments, I missed some comments in the earlier patches, ...
4 years ago (2016-12-20 22:16:54 UTC) #40
Devlin
https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json#newcode153 chrome/common/extensions/api/_permission_features.json:153: "clipboardReadWrite": { On 2016/12/20 22:16:53, jennyz wrote: > On ...
3 years, 12 months ago (2016-12-21 23:58:39 UTC) #41
Devlin
https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json File extensions/common/api/_api_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json#newcode117 extensions/common/api/_api_features.json:117: "permission:clipboard", "permission:clipboardReadWrite" On 2016/12/20 22:16:54, jennyz wrote: > On ...
3 years, 12 months ago (2016-12-22 16:07:49 UTC) #42
jennyz
https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/chrome/common/extensions/api/_permission_features.json#newcode153 chrome/common/extensions/api/_permission_features.json:153: "clipboardReadWrite": { On 2016/12/21 23:58:38, Devlin wrote: > On ...
3 years, 12 months ago (2016-12-22 22:45:21 UTC) #43
jennyz
https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json File extensions/common/api/_api_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json#newcode117 extensions/common/api/_api_features.json:117: "permission:clipboard", "permission:clipboardReadWrite" On 2016/12/22 22:45:20, jennyz wrote: > On ...
3 years, 12 months ago (2016-12-22 23:31:41 UTC) #44
Devlin
https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json File extensions/common/api/_api_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json#newcode117 extensions/common/api/_api_features.json:117: "permission:clipboard", "permission:clipboardReadWrite" On 2016/12/22 23:31:40, jennyz wrote: > On ...
3 years, 11 months ago (2016-12-27 17:08:00 UTC) #45
jennyz
https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json File extensions/common/api/_api_features.json (right): https://codereview.chromium.org/2379573008/diff/100001/extensions/common/api/_api_features.json#newcode117 extensions/common/api/_api_features.json:117: "permission:clipboard", "permission:clipboardReadWrite" On 2016/12/27 17:08:00, Devlin wrote: > On ...
3 years, 11 months ago (2016-12-29 05:16:03 UTC) #47
dcheng
The CL as a whole looks reasonable to me, so as long as devlin is ...
3 years, 11 months ago (2016-12-29 09:22:22 UTC) #48
Devlin
Nice! This is looking much better. :) There are a few last nits, and I'd ...
3 years, 11 months ago (2016-12-29 16:53:17 UTC) #50
meacer
On 2016/12/29 16:53:17, Devlin wrote: > Nice! This is looking much better. :) > > ...
3 years, 11 months ago (2016-12-29 19:09:31 UTC) #51
jennyz
On 2016/12/29 19:09:31, Mustafa Emre Acer wrote: > On 2016/12/29 16:53:17, Devlin wrote: > > ...
3 years, 11 months ago (2016-12-29 20:17:37 UTC) #53
jennyz
https://codereview.chromium.org/2379573008/diff/380001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2379573008/diff/380001/chrome/app/generated_resources.grd#newcode3894 chrome/app/generated_resources.grd:3894: + <message name="IDS_EXTENSION_PROMPT_WARNING_CLIPBOARD_READWRITE" desc="Permission string for acess to clipboard ...
3 years, 11 months ago (2016-12-29 20:20:04 UTC) #54
jennyz
3 years, 11 months ago (2016-12-29 20:20:08 UTC) #55
Devlin
lgtm, but please wait for meacer@ to sign off.
3 years, 11 months ago (2017-01-04 19:16:21 UTC) #56
meacer
On 2017/01/04 19:16:21, Devlin (sheriff - maybe slow) wrote: > lgtm, but please wait for ...
3 years, 11 months ago (2017-01-04 19:21:51 UTC) #57
dcheng
LGTM with two nits https://codereview.chromium.org/2379573008/diff/420001/chrome/browser/extensions/clipboard_extension_helper_chromeos.cc File chrome/browser/extensions/clipboard_extension_helper_chromeos.cc (right): https://codereview.chromium.org/2379573008/diff/420001/chrome/browser/extensions/clipboard_extension_helper_chromeos.cc#newcode43 chrome/browser/extensions/clipboard_extension_helper_chromeos.cc:43: default: Nit: Remove this case, ...
3 years, 11 months ago (2017-01-04 19:45:23 UTC) #58
jennyz
https://codereview.chromium.org/2379573008/diff/420001/chrome/browser/extensions/clipboard_extension_helper_chromeos.cc File chrome/browser/extensions/clipboard_extension_helper_chromeos.cc (right): https://codereview.chromium.org/2379573008/diff/420001/chrome/browser/extensions/clipboard_extension_helper_chromeos.cc#newcode43 chrome/browser/extensions/clipboard_extension_helper_chromeos.cc:43: default: On 2017/01/04 19:45:23, dcheng wrote: > Nit: Remove ...
3 years, 11 months ago (2017-01-04 23:05:31 UTC) #59
jennyz
3 years, 11 months ago (2017-01-04 23:20:48 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379573008/440001
3 years, 11 months ago (2017-01-04 23:22:27 UTC) #64
commit-bot: I haz the power
Committed patchset #21 (id:440001)
3 years, 11 months ago (2017-01-05 01:34:23 UTC) #67
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/6298fc54177c7f2919fc158a3b43e7a3e08f36fe Cr-Commit-Position: refs/heads/master@{#441546}
3 years, 11 months ago (2017-01-05 01:36:39 UTC) #69
jennyz
3 years, 11 months ago (2017-01-05 22:53:32 UTC) #71
Message was sent while issue was closed.

          

Powered by Google App Engine
This is Rietveld 408576698