Index: chrome/common/extensions/api/document_scan.idl |
diff --git a/chrome/common/extensions/api/document_scan.idl b/chrome/common/extensions/api/document_scan.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..16a1cdcae3fb7a190d77ee3d46c7eedfd384070a |
--- /dev/null |
+++ b/chrome/common/extensions/api/document_scan.idl |
@@ -0,0 +1,36 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Use the <code>chrome.document_scan</code> API to discover and retrieve |
+// images from attached paper document scanners. |
+namespace documentScan { |
+ dictionary ScanOptions { |
+ // The MIME types that are accepted by the caller. |
+ DOMString[]? mimeTypes; |
+ |
+ // The number of scanned images allowed (defaults to 1). |
+ long? maxImages; |
asargent_no_longer_on_chrome
2014/10/23 22:15:57
How are we expecting developers to handle multi-pa
Paul Stewart
2014/10/23 23:06:58
This is simply a hint to the UI handling the image
|
+ }; |
+ |
+ dictionary ScanResults { |
+ // The data image URLs in a form that can be passed as the "src" value to |
+ // an image tag. |
+ DOMString[] dataUrls; |
asargent_no_longer_on_chrome
2014/10/23 22:15:57
I wonder if it would be better to cache the image
Paul Stewart
2014/10/23 23:06:58
I'd prefer to move forward as-is. This does work
|
+ |
+ // The MIME type of |dataUrls|. |
+ DOMString mimeType; |
+ }; |
+ |
+ // Callback from the <code>scan</code> method; on success (result == true) |
asargent_no_longer_on_chrome
2014/10/23 22:15:57
nit: looks like you removed |result| in favor of j
Paul Stewart
2014/10/23 23:06:58
Done.
|
+ // the results from the scan is returned in |results|. |
+ callback ScanCallback = void (ScanResults results); |
+ |
+ interface Functions { |
+ // Performs a document scan. On success, the PNG data will be |
+ // sent to the callback. |
+ // |options| : <code>Options</code> object containing scan parameters. |
+ // |callback| : Called with the result and data from the scan. |
+ static void scan(ScanOptions options, ScanCallback callback); |
+ }; |
+}; |