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

Side by Side Diff: chrome/browser/extensions/api/document_scan/document_scan_interface.h

Issue 286933006: Implement a JavaScript API for document scanning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Starting over. This used to be 286933006 Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include <string>
6 #include <vector>
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10
11 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
12 #define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
13
14 namespace extensions {
15
16 namespace api {
17
18 class DocumentScanInterface {
19 public:
20 struct ScannerDescription {
21 ScannerDescription();
22 ~ScannerDescription();
23 std::string name;
24 std::string manufacturer;
25 std::string model;
26 std::string scanner_type;
27 std::string image_mime_type;
28 };
29
30 enum ScanMode {
31 kScanModeColor,
32 kScanModeGray,
33 kScanModeLineart
34 };
35
36 typedef base::Callback<void(
37 const std::vector<ScannerDescription>& scanner_descriptions,
38 const std::string& error)> ListScannersResultsCallback;
39
40 typedef base::Callback<void(
41 const std::string& scanned_image,
42 const std::string& mime_type,
43 const std::string& error)> ScanResultsCallback;
44
45 virtual ~DocumentScanInterface();
46
47 virtual void Scan(const std::string& scanner_name,
48 ScanMode mode,
49 int resolution_dpi,
50 const ScanResultsCallback& callback) = 0;
51 virtual void ListScanners(const ListScannersResultsCallback& callback) = 0;
52
53 // Creates a platform-specific DocumentScanInterface instance.
54 static DocumentScanInterface *CreateInstance();
55
56 protected:
57 DocumentScanInterface();
58 };
59
60 } // namespace api
61
62 } // namespace extensions
63
64 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698