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

Side by Side Diff: extensions/browser/api/document_scan/document_scan_api.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/memory/scoped_ptr.h" 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" 9 #include "extensions/browser/api/async_api_function.h"
10 #include "extensions/browser/api/document_scan/document_scan_interface.h"
11 #include "extensions/common/api/document_scan.h"
12 12
13 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ 13 #ifndef EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_
James Cook 2015/02/05 19:02:59 This is wrong. Move this to the top of the file, b
babu 2015/02/05 21:34:02 Done.
14 #define CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ 14 #define EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 namespace api { 18 namespace core_api {
19 19
20 class DocumentScanScanFunction : public AsyncApiFunction { 20 class DocumentScanScanFunction : public AsyncApiFunction {
21 public: 21 public:
22 DECLARE_EXTENSION_FUNCTION("documentScan.scan", 22 DECLARE_EXTENSION_FUNCTION("documentScan.scan", DOCUMENT_SCAN_SCAN)
23 DOCUMENT_SCAN_SCAN)
24 DocumentScanScanFunction(); 23 DocumentScanScanFunction();
25 24
26 protected: 25 protected:
27 ~DocumentScanScanFunction() override; 26 ~DocumentScanScanFunction() override;
28 27
29 // AsyncApiFunction: 28 // AsyncApiFunction:
30 bool Prepare() override; 29 bool Prepare() override;
31 void AsyncWorkStart() override; 30 void AsyncWorkStart() override;
32 bool Respond() override; 31 bool Respond() override;
33 32
34 private: 33 private:
35 friend class DocumentScanScanFunctionTest; 34 friend class DocumentScanScanFunctionTest;
36 35
37 void OnScannerListReceived( 36 void OnScannerListReceived(
38 const std::vector<DocumentScanInterface::ScannerDescription>& 37 const std::vector<DocumentScanInterface::ScannerDescription>&
39 scanner_descriptions, 38 scanner_descriptions,
40 const std::string& error); 39 const std::string& error);
41 void OnResultsReceived(const std::string& scanned_image, 40 void OnResultsReceived(const std::string& scanned_image,
42 const std::string& mime_type, 41 const std::string& mime_type,
43 const std::string& error); 42 const std::string& error);
44 43
45 scoped_ptr<document_scan::Scan::Params> params_; 44 scoped_ptr<document_scan::Scan::Params> params_;
46 scoped_ptr<DocumentScanInterface> document_scan_interface_; 45 scoped_ptr<DocumentScanInterface> document_scan_interface_;
47 46
48 DISALLOW_COPY_AND_ASSIGN(DocumentScanScanFunction); 47 DISALLOW_COPY_AND_ASSIGN(DocumentScanScanFunction);
49 }; 48 };
50 49
51 } // namespace api 50 } // namespace core_api
52 51
53 } // namespace extensions 52 } // namespace extensions
54 53
55 #endif // CHROME_BROWSER_EXTENSIONS_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_ 54 #endif // EXTENSIONS_BROWSER_API_DOCUMENT_SCAN_DOCUMENT_SCAN_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698