Index: chrome/browser/extensions/api/document_scan/document_scan_api.h |
diff --git a/chrome/browser/extensions/api/document_scan/document_scan_api.h b/chrome/browser/extensions/api/document_scan/document_scan_api.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..253bb9b6780889f9b244db86170078c33d97afbb |
--- /dev/null |
+++ b/chrome/browser/extensions/api/document_scan/document_scan_api.h |
@@ -0,0 +1,66 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/common/extensions/api/document_scan.h" |
+#include "chromeos/dbus/lorgnette_manager_client.h" |
+#include "extensions/browser/api/async_api_function.h" |
+ |
+#ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ |
+#define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ |
+ |
+namespace base { |
+class FilePath; |
+} // namespace base |
+ |
+namespace extensions { |
+ |
+namespace api { |
+ |
+class DocumentScanListScannersFunction : public AsyncApiFunction { |
+ public: |
+ DECLARE_EXTENSION_FUNCTION("documentScan.listScanners", |
+ DOCUMENT_SCAN_LISTSCANNERS) |
+ DocumentScanListScannersFunction(); |
+ |
+ protected: |
+ ~DocumentScanListScannersFunction(); |
+ |
+ // AsyncApiFunction: |
+ virtual bool Prepare() OVERRIDE; |
+ virtual void AsyncWorkStart() OVERRIDE; |
+ virtual bool Respond() OVERRIDE; |
+ |
+ private: |
+ void OnScannerListReceived( |
+ bool succeeded, |
+ const chromeos::LorgnetteManagerClient::ScannerTable &scanners); |
+}; |
+ |
+class DocumentScanScanFunction : public AsyncApiFunction { |
+ public: |
+ DECLARE_EXTENSION_FUNCTION("documentScan.scan", |
+ DOCUMENT_SCAN_SCAN) |
+ DocumentScanScanFunction(); |
+ |
+ protected: |
+ ~DocumentScanScanFunction(); |
+ |
+ // AsyncApiFunction: |
+ virtual bool Prepare() OVERRIDE; |
+ virtual void AsyncWorkStart() OVERRIDE; |
+ virtual bool Respond() OVERRIDE; |
+ |
+ private: |
+ bool GetDocumentScanFilename(base::FilePath* filename); |
+ void ScanImageCallback(const base::FilePath &filename, bool succeeded); |
+ void FinishScan(); |
+ |
+ scoped_ptr<document_scan::Scan::Params> params_; |
+}; |
+ |
+} // namespace api |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ |