-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documentScan: Add DocumentScanAPIHandler
The existing documentScan.scan function is implemented directly in the API function class because there was only a single function in the documentScan API. New functions are going to be added that need to talk to the same DocumentScan service, so introduce a separate DocumentScanAPIHandler class and move the existing logic into it. Because the additional scanning functions are going to have requirements similar to the chrome.printing API, the new class is modeled closely after PrintingAPIHandler. It provides more functionality than is needed for the existing scan function, but will be appropriate once the new API functions start being added. The only behavior change in the new version is that MIME types are checked before fetching the list of available scanners. This means that passing an invalid MIME type with no scanners attached will now return "Invalid MIME type" instead of "No scanners available". Scanner names are not exposed in the API and both checks have to pass before a scan is started, so the only real effect is to make the invalid MIME case fail faster. Bug: b:297435442 Test: tast run documentscanapi.Scan Test: Sample extension with physical scanners on a Chromebook Change-Id: If85f32e2a402af1b90fcffaff593f4f883bebf9b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916906 Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org> Commit-Queue: Benjamin Gordon <bmgordon@chromium.org> Cr-Commit-Position: refs/heads/main@{#1212664}
- Loading branch information
Showing
10 changed files
with
517 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bmgordon@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.