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

Unified 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: Starting over. This used to be 286933006 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/document_scan/document_scan_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..30686b7b48ba386c79e39c1f89840aca8561490f
--- /dev/null
+++ b/chrome/browser/extensions/api/document_scan/document_scan_api.h
@@ -0,0 +1,55 @@
+// 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 <string>
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/api/document_scan/document_scan_interface.h"
+#include "chrome/common/extensions/api/document_scan.h"
+#include "extensions/browser/api/async_api_function.h"
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
+#define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
+
+namespace extensions {
+
+namespace api {
+
+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:
+ friend class DocumentScanScanFunctionTest;
+
+ void OnScannerListReceived(
+ const std::vector<DocumentScanInterface::ScannerDescription>&
+ scanner_descriptions,
+ const std::string& error);
+ void OnResultsReceived(const std::string& scanned_image,
+ const std::string& mime_type,
+ const std::string& error);
+
+ scoped_ptr<document_scan::Scan::Params> params_;
+ scoped_ptr<DocumentScanInterface> document_scan_interface_;
+
+ DISALLOW_COPY_AND_ASSIGN(DocumentScanScanFunction);
+};
+
+} // namespace api
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_FUNCTION_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/document_scan/document_scan_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698