diff options
Diffstat (limited to 'chromium/extensions/common/api/document_scan.idl')
-rw-r--r-- | chromium/extensions/common/api/document_scan.idl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/chromium/extensions/common/api/document_scan.idl b/chromium/extensions/common/api/document_scan.idl new file mode 100644 index 00000000000..a2bdcca45c0 --- /dev/null +++ b/chromium/extensions/common/api/document_scan.idl @@ -0,0 +1,37 @@ +// 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.documentScan</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; + }; + + dictionary ScanResults { + // The data image URLs in a form that can be passed as the "src" value to + // an image tag. + DOMString[] dataUrls; + + // The MIME type of <code>dataUrls</code>. + DOMString mimeType; + }; + + // Callback from the <code>scan</code> method. + // |result| The results from the scan, if successful. + // Otherwise will return null and set runtime.lastError. + callback ScanCallback = void (ScanResults result); + + interface Functions { + // Performs a document scan. On success, the PNG data will be + // sent to the callback. + // |options| : Object containing scan parameters. + // |callback| : Called with the result and data from the scan. + static void scan(ScanOptions options, ScanCallback callback); + }; +}; |