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

Issue 16924017: A few minor changes to the chrome.downloads extension API (Closed)

Created:
7 years, 6 months ago by benjhayden
Modified:
7 years, 4 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

A few minor changes to the chrome.downloads extension API Reviewers: jhawkins: webui Done: asanka: */download/* jam: content/public/* asargent: */extensions/* Replaced the "Invalid operation" error message with more specific and helpful messages Add DownloadItem.referrer Add DownloadItem.estimatedEndTime Add DownloadItem.canResume Change DownloadQuery.limit to default to 1000 Change 'conflict_action' to 'conflictAction'. Change DownloadQuery.orderBy and DownloadQuery.query to arrays of strings Remove DownloadItem.dangerAccepted in favor of DownloadItem.danger == 'accepted' Add showDefaultFolder(). Disallow access to packaged_apps. download() now updates the Download.Sources histogram. http://crbug.com/240322 Document using startedAfter and limit to page through search() results. DownloadItem.error is now a string enum instead of mysterious numbers. Add downloads.removeFile(id) and DownloadItem::DeleteFile() so that the file may be deleted separately from the history entry. Calling open() for dangerous downloads has always been guaranteed to return kInvalidOperation because unaccepted dangerous downloads cannot transition to state='complete', and open() returns kInvalidOperation for incomplete items. We can wait until after launch to figure out whether there needs to be some mechanism to allow extensions to override the request header blacklist. This seems like an edge case for which we may never receive feature requests. Staged docs preview: http://basho.cam.corp.google.com:8000/extensions/downloads.html#type-DownloadItem BUG=240322 R=asanka@chromium.org, asargent@chromium.org, jam@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=214133

Patch Set 1 : @r208716 #

Total comments: 2

Patch Set 2 : @r211135 #

Total comments: 12

Patch Set 3 : @r212092 #

Total comments: 16

Patch Set 4 : @r213855 #

Total comments: 6

Patch Set 5 : @r213855 #

Total comments: 2

Patch Set 6 : @r214130 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+862 lines, -4020 lines) Patch
M chrome/browser/download/download_danger_prompt.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/download/download_danger_prompt.cc View 1 2 3 8 chunks +28 lines, -46 lines 0 comments Download
M chrome/browser/download/download_danger_prompt_browsertest.cc View 1 2 3 3 chunks +10 lines, -11 lines 0 comments Download
M chrome/browser/download/download_query.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_query.cc View 1 3 chunks +37 lines, -21 lines 0 comments Download
M chrome/browser/download/download_query_unittest.cc View 1 2 3 4 chunks +29 lines, -3 lines 0 comments Download
M chrome/browser/download/download_util.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.h View 1 2 3 4 5 6 chunks +61 lines, -13 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 1 2 3 4 5 44 chunks +321 lines, -168 lines 0 comments Download
A + chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 3 4 45 chunks +197 lines, -126 lines 0 comments Download
D chrome/browser/extensions/api/downloads/downloads_api_unittest.cc View 1 2 3 1 chunk +0 lines, -3544 lines 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.cc View 1 2 3 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/api/_permission_features.json View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/api/downloads.idl View 1 2 3 18 chunks +114 lines, -71 lines 0 comments Download
M chrome/renderer/resources/extensions/downloads_custom_bindings.js View 1 2 3 4 1 chunk +23 lines, -6 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
benjhayden
PTAL
7 years, 6 months ago (2013-06-14 20:24:52 UTC) #1
asanka
https://codereview.chromium.org/16924017/diff/19001/chrome/browser/download/download_danger_prompt.h File chrome/browser/download/download_danger_prompt.h (right): https://codereview.chromium.org/16924017/diff/19001/chrome/browser/download/download_danger_prompt.h#newcode44 chrome/browser/download/download_danger_prompt.h:44: const base::Closure& destroyed); I'm guessing this would be the ...
7 years, 5 months ago (2013-06-28 21:59:59 UTC) #2
benjhayden
PTAL https://codereview.chromium.org/16924017/diff/19001/chrome/browser/download/download_danger_prompt.h File chrome/browser/download/download_danger_prompt.h (right): https://codereview.chromium.org/16924017/diff/19001/chrome/browser/download/download_danger_prompt.h#newcode44 chrome/browser/download/download_danger_prompt.h:44: const base::Closure& destroyed); On 2013/06/28 21:59:59, asanka wrote: ...
7 years, 5 months ago (2013-07-11 15:32:28 UTC) #3
asanka
https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1136 chrome/browser/extensions/api/downloads/downloads_api.cc:1136: download_item->GetFullPath()), I'd avoid deleting files unless the download is ...
7 years, 5 months ago (2013-07-16 19:57:52 UTC) #4
asargent_no_longer_on_chrome
https://codereview.chromium.org/16924017/diff/156001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/156001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode856 chrome/browser/extensions/api/downloads/downloads_api.cc:856: std::string* message_out, style nit: no newline after opening ( ...
7 years, 5 months ago (2013-07-17 22:36:57 UTC) #5
benjhayden
https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1136 chrome/browser/extensions/api/downloads/downloads_api.cc:1136: download_item->GetFullPath()), On 2013/07/16 19:57:52, asanka wrote: > I'd avoid ...
7 years, 5 months ago (2013-07-19 15:53:54 UTC) #6
asargent_no_longer_on_chrome
lgtm https://codereview.chromium.org/16924017/diff/156001/chrome/common/extensions/api/downloads.idl File chrome/common/extensions/api/downloads.idl (right): https://codereview.chromium.org/16924017/diff/156001/chrome/common/extensions/api/downloads.idl#newcode108 chrome/common/extensions/api/downloads.idl:108: DOMString referrer; On 2013/07/19 15:53:55, benjhayden_chromium wrote: > ...
7 years, 5 months ago (2013-07-22 19:15:52 UTC) #7
asanka
https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1291 chrome/browser/extensions/api/downloads/downloads_api.cc:1291: DownloadShelf* shelf = GetCurrentBrowser()->window()->GetDownloadShelf(); On 2013/07/19 15:53:55, benjhayden_chromium wrote: ...
7 years, 5 months ago (2013-07-23 21:13:47 UTC) #8
asargent_no_longer_on_chrome
https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/121001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1291 chrome/browser/extensions/api/downloads/downloads_api.cc:1291: DownloadShelf* shelf = GetCurrentBrowser()->window()->GetDownloadShelf(); On 2013/07/23 21:13:48, asanka wrote: ...
7 years, 5 months ago (2013-07-23 21:36:57 UTC) #9
benjhayden
PTAL I removed setShelfVisible and am pursuing other solutions to disabling the shelf. https://codereview.chromium.org/19789018/
7 years, 5 months ago (2013-07-24 20:36:44 UTC) #10
asargent_no_longer_on_chrome
still lgtm
7 years, 5 months ago (2013-07-24 21:06:41 UTC) #11
benjhayden
Andy, Asanka, James, John: PTAL
7 years, 5 months ago (2013-07-26 13:38:20 UTC) #12
benjhayden
asargent: */extensions/* asanka: */download/* jam: content/public/* jhawkins: webui
7 years, 5 months ago (2013-07-26 15:41:56 UTC) #13
jam
content/public lgtm
7 years, 5 months ago (2013-07-26 15:42:56 UTC) #14
asanka
What's the general policy regarding enums for a stable extensions API? Is it considered an ...
7 years, 5 months ago (2013-07-26 15:47:22 UTC) #15
benjhayden
On 2013/07/26 15:47:22, asanka wrote: > What's the general policy regarding enums for a stable ...
7 years, 5 months ago (2013-07-26 16:28:26 UTC) #16
asargent_no_longer_on_chrome
On 2013/07/26 16:28:26, benjhayden_chromium wrote: > On 2013/07/26 15:47:22, asanka wrote: > > What's the ...
7 years, 5 months ago (2013-07-26 17:35:09 UTC) #17
benjhayden
PTAL https://codereview.chromium.org/16924017/diff/336001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/336001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1068 chrome/browser/extensions/api/downloads/downloads_api.cc:1068: Fault(download_item->GetState() != DownloadItem::IN_PROGRESS, On 2013/07/26 15:47:22, asanka wrote: ...
7 years, 5 months ago (2013-07-26 19:56:25 UTC) #18
asanka
LGTM with the fix below. https://codereview.chromium.org/16924017/diff/381001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/381001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1069 chrome/browser/extensions/api/downloads/downloads_api.cc:1069: Fault(download_item->IsPaused() && !download_item->CanResume(), !download_item->CanResume() ...
7 years, 5 months ago (2013-07-26 20:28:27 UTC) #19
benjhayden
https://codereview.chromium.org/16924017/diff/381001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/16924017/diff/381001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1069 chrome/browser/extensions/api/downloads/downloads_api.cc:1069: Fault(download_item->IsPaused() && !download_item->CanResume(), On 2013/07/26 20:28:28, asanka wrote: > ...
7 years, 4 months ago (2013-07-28 17:37:53 UTC) #20
benjhayden
7 years, 4 months ago (2013-07-28 18:36:15 UTC) #21
Message was sent while issue was closed.
Committed patchset #6 manually as r214133 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698