// 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 chrome.document_scan 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 |dataUrls|. DOMString mimeType; }; // Callback from the scan method; on success // 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| : Options object containing scan parameters. // |callback| : Called with the result and data from the scan. static void scan(ScanOptions options, ScanCallback callback); }; };