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

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

Issue 286933006: Implement a JavaScript API for document scanning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address kalman@'s comments. Still need tests. Created 6 years, 2 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
(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/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/document_scan/document_scan_interface.h"
10 #include "chrome/common/extensions/api/document_scan.h"
11 #include "extensions/browser/api/async_api_function.h"
12
13 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
14 #define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
15
16 namespace extensions {
17
18 namespace api {
19
20 class DocumentScanScanFunction : public AsyncApiFunction {
21 public:
22 DECLARE_EXTENSION_FUNCTION("documentScan.scan",
23 DOCUMENT_SCAN_SCAN)
24 DocumentScanScanFunction();
25
26 protected:
27 ~DocumentScanScanFunction();
28
29 // AsyncApiFunction:
30 virtual bool Prepare() OVERRIDE;
31 virtual void AsyncWorkStart() OVERRIDE;
32 virtual bool Respond() OVERRIDE;
33
34 private:
35 void OnScannerListReceived(
36 const std::vector<DocumentScanInterface::ScannerDescription>&
37 scanner_descriptions,
38 const std::string& error);
39 void OnResultsReceived(const std::string& scanned_image,
40 const std::string& error);
41
42 scoped_ptr<document_scan::Scan::Params> params_;
43 scoped_ptr<DocumentScanInterface> document_scan_interface_;
44
45 DISALLOW_COPY_AND_ASSIGN(DocumentScanScanFunction);
46 };
47
48 } // namespace api
49
50 } // namespace extensions
51
52 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698