OLD | NEW |
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 "extensions/browser/api/document_scan/document_scan_api.h" | 5 #include "extensions/browser/api/document_scan/document_scan_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "extensions/browser/extension_system.h" | 10 #include "extensions/browser/extension_system.h" |
11 | 11 |
12 using content::BrowserThread; | 12 using content::BrowserThread; |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const char kScannerNotAvailable[] = "Scanner not available"; | 16 const char kScannerNotAvailable[] = "Scanner not available"; |
17 const char kUserGestureRequiredError[] = | 17 const char kUserGestureRequiredError[] = |
18 "User gesture required to perform scan"; | 18 "User gesture required to perform scan"; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 namespace core_api { | 24 namespace api { |
25 | 25 |
26 DocumentScanScanFunction::DocumentScanScanFunction() | 26 DocumentScanScanFunction::DocumentScanScanFunction() |
27 : document_scan_interface_(DocumentScanInterface::CreateInstance()) { | 27 : document_scan_interface_(DocumentScanInterface::CreateInstance()) { |
28 } | 28 } |
29 | 29 |
30 DocumentScanScanFunction::~DocumentScanScanFunction() { | 30 DocumentScanScanFunction::~DocumentScanScanFunction() { |
31 } | 31 } |
32 | 32 |
33 bool DocumentScanScanFunction::Prepare() { | 33 bool DocumentScanScanFunction::Prepare() { |
34 set_work_thread_id(BrowserThread::FILE); | 34 set_work_thread_id(BrowserThread::FILE); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 AsyncWorkCompleted(); | 112 AsyncWorkCompleted(); |
113 | 113 |
114 // Balance the AddRef in AsyncWorkStart(). | 114 // Balance the AddRef in AsyncWorkStart(). |
115 Release(); | 115 Release(); |
116 } | 116 } |
117 | 117 |
118 bool DocumentScanScanFunction::Respond() { | 118 bool DocumentScanScanFunction::Respond() { |
119 return error_.empty(); | 119 return error_.empty(); |
120 } | 120 } |
121 | 121 |
122 } // namespace core_api | 122 } // namespace api |
123 | 123 |
124 } // namespace extensions | 124 } // namespace extensions |
OLD | NEW |