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

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

Issue 899523004: Move chrome.documentScan API to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 10
11 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_ 11 #ifndef EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
James Cook 2015/02/05 19:02:59 move to top of file
babu 2015/02/05 21:34:03 Done.
12 #define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_ 12 #define EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 namespace api { 16 namespace core_api {
17 17
18 class DocumentScanInterface { 18 class DocumentScanInterface {
19 public: 19 public:
20 struct ScannerDescription { 20 struct ScannerDescription {
21 ScannerDescription(); 21 ScannerDescription();
22 ~ScannerDescription(); 22 ~ScannerDescription();
23 std::string name; 23 std::string name;
24 std::string manufacturer; 24 std::string manufacturer;
25 std::string model; 25 std::string model;
26 std::string scanner_type; 26 std::string scanner_type;
27 std::string image_mime_type; 27 std::string image_mime_type;
28 }; 28 };
29 29
30 enum ScanMode { 30 enum ScanMode { kScanModeColor, kScanModeGray, kScanModeLineart };
31 kScanModeColor,
32 kScanModeGray,
33 kScanModeLineart
34 };
35 31
36 typedef base::Callback<void( 32 typedef base::Callback<void(
37 const std::vector<ScannerDescription>& scanner_descriptions, 33 const std::vector<ScannerDescription>& scanner_descriptions,
38 const std::string& error)> ListScannersResultsCallback; 34 const std::string& error)> ListScannersResultsCallback;
39 35
40 typedef base::Callback<void( 36 typedef base::Callback<void(const std::string& scanned_image,
41 const std::string& scanned_image, 37 const std::string& mime_type,
42 const std::string& mime_type, 38 const std::string& error)> ScanResultsCallback;
43 const std::string& error)> ScanResultsCallback;
44 39
45 virtual ~DocumentScanInterface(); 40 virtual ~DocumentScanInterface();
46 41
47 virtual void Scan(const std::string& scanner_name, 42 virtual void Scan(const std::string& scanner_name,
48 ScanMode mode, 43 ScanMode mode,
49 int resolution_dpi, 44 int resolution_dpi,
50 const ScanResultsCallback& callback) = 0; 45 const ScanResultsCallback& callback) = 0;
51 virtual void ListScanners(const ListScannersResultsCallback& callback) = 0; 46 virtual void ListScanners(const ListScannersResultsCallback& callback) = 0;
52 47
53 // Creates a platform-specific DocumentScanInterface instance. 48 // Creates a platform-specific DocumentScanInterface instance.
54 static DocumentScanInterface *CreateInstance(); 49 static DocumentScanInterface* CreateInstance();
55 50
56 protected: 51 protected:
57 DocumentScanInterface(); 52 DocumentScanInterface();
58 }; 53 };
59 54
60 } // namespace api 55 } // namespace core_api
61 56
62 } // namespace extensions 57 } // namespace extensions
63 58
64 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H _ 59 #endif // EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_INTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698