OLD | NEW |
(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 friend class DocumentScanScanFunctionTest; |
| 36 |
| 37 void OnScannerListReceived( |
| 38 const std::vector<DocumentScanInterface::ScannerDescription>& |
| 39 scanner_descriptions, |
| 40 const std::string& error); |
| 41 void OnResultsReceived(const std::string& scanned_image, |
| 42 const std::string& mime_type, |
| 43 const std::string& error); |
| 44 |
| 45 scoped_ptr<document_scan::Scan::Params> params_; |
| 46 scoped_ptr<DocumentScanInterface> document_scan_interface_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(DocumentScanScanFunction); |
| 49 }; |
| 50 |
| 51 } // namespace api |
| 52 |
| 53 } // namespace extensions |
| 54 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_ |
OLD | NEW |