Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1698)

Unified Diff: chrome/common/extensions/api/document_scan.idl

Issue 286933006: Implement a JavaScript API for document scanning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop vestigial file-related code; kOnstify strings Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8a4cfc1172abf49c00e3c724f30a64f2a76a9f08
--- /dev/null
+++ b/chrome/common/extensions/api/document_scan.idl
@@ -0,0 +1,57 @@
+// 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 {
+
+ // Represents a document scanner's properties.
+ dictionary ScannerInfo {
+ // The name of a connected scanner.
+ DOMString name;
+
+ // The manufacturer name of the scanner.
+ DOMString manufacturer;
+
+ // The model name of the scanner.
+ DOMString model;
+
+ // The type of scanner.
+ DOMString type;
+ };
+
+ // Mode to perform the scan in.
+ enum ScanMode { color, gray, lineart };
+
+ dictionary ScanOptions {
+ // The mode to perform the scan in: color, gray or lineart.
+ ScanMode? mode;
+
+ // The resolution in dpi to perform the scan.
+ long? resolutionDpi;
+ };
+
+ // Callback from the <code>listScanners</code> method.
+ callback ListScannersCallback = void (ScannerInfo[] scannerInfos);
+
+ // Callback from the <code>scan</code> method; on success (result == true)
+ // PNG image data from the scan is returned in |image_data|. The image
+ // is also saved to the user's download folder.
mef 2014/05/23 18:38:18 Is saving to download folder specific to ChromeOS?
Paul Stewart 2014/05/23 19:45:36 You just found a vestige! Patch set 6 removes tha
+ callback ScanCallback = void (ArrayBuffer image_data);
+
+ interface Functions {
+ // Returns information about available scanners on the system.
+ // The list is regenerated each time this method is called.
+ // |callback| : Called with the list of <code>ScannerInfo</code> objects.
+ static void listScanners(ListScannersCallback callback);
+
+ // Performs a document scan. On success, the PNG data will also be
+ // sent to the callback.
+ // |scanner| : Name of the scanner to acquire an image from.
+ // |options| : <code>ScanObject</code> object containing scan parameters.
+ // |callback| : Called with the result and data from the scan.
+ static void scan(DOMString scanner, ScanOptions options,
+ ScanCallback callback);
+ };
+};
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/permissions/chrome_api_permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698