Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / common / api / document_scan.idl
bloba2bdcca45c030b843c8754b09eb971f86da9d1fb
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Use the <code>chrome.documentScan</code> API to discover and retrieve
6 // images from attached paper document scanners.
7 namespace documentScan {
8 dictionary ScanOptions {
9 // The MIME types that are accepted by the caller.
10 DOMString[]? mimeTypes;
12 // The number of scanned images allowed (defaults to 1).
13 long? maxImages;
16 dictionary ScanResults {
17 // The data image URLs in a form that can be passed as the "src" value to
18 // an image tag.
19 DOMString[] dataUrls;
21 // The MIME type of <code>dataUrls</code>.
22 DOMString mimeType;
25 // Callback from the <code>scan</code> method.
26 // |result| The results from the scan, if successful.
27 // Otherwise will return null and set runtime.lastError.
28 callback ScanCallback = void (ScanResults result);
30 interface Functions {
31 // Performs a document scan. On success, the PNG data will be
32 // sent to the callback.
33 // |options| : Object containing scan parameters.
34 // |callback| : Called with the result and data from the scan.
35 static void scan(ScanOptions options, ScanCallback callback);