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

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: Rebase to ToT complete 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 std::string name;
22 std::string manufacturer;
23 std::string model;
24 std::string scanner_type;
25 std::string image_mime_type;
26 };
27
28 enum ScanMode {
29 kScanModeColor,
30 kScanModeGray,
31 kScanModeLineart
32 };
33
34 typedef base::Callback<void(
35 const std::vector<ScannerDescription>& scanner_descriptions,
36 const std::string& error)> ListScannersResultsCallback;
37
38 typedef base::Callback<void(
39 const std::string& scanned_image,
40 const std::string& mime_type,
41 const std::string& error)> ScanResultsCallback;
42
43 virtual ~DocumentScanInterface() {}
44
45 virtual void Scan(const std::string& scanner_name,
46 ScanMode mode,
47 int resolution_dpi,
48 const ScanResultsCallback& callback) = 0;
49 virtual void ListScanners(const ListScannersResultsCallback& callback) = 0;
50
51 // Creates a platform-specific DocumentScanInterface instance.
52 static DocumentScanInterface *CreateInstance();
53
54 protected:
55 DocumentScanInterface() {}
56 };
57
58 } // namespace api
59
60 } // namespace extensions
61
62 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698