| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 "modules/shapedetection/BarcodeDetector.h" |
| 6 |
| 7 #include "core/dom/DOMException.h" |
| 8 #include "core/frame/LocalDOMWindow.h" |
| 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/html/canvas/CanvasImageSource.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 BarcodeDetector* BarcodeDetector::create(ScriptState* scriptState) { |
| 15 return new BarcodeDetector(*scriptState->domWindow()->frame()); |
| 16 } |
| 17 |
| 18 BarcodeDetector::BarcodeDetector(LocalFrame& frame) : ShapeDetector(frame) {} |
| 19 |
| 20 ScriptPromise BarcodeDetector::detect( |
| 21 ScriptState* scriptState, |
| 22 const CanvasImageSourceUnion& imageSource) { |
| 23 return detectShapes(scriptState, ShapeDetector::DetectorType::Barcode, |
| 24 imageSource); |
| 25 } |
| 26 |
| 27 DEFINE_TRACE(BarcodeDetector) { |
| 28 ShapeDetector::trace(visitor); |
| 29 } |
| 30 |
| 31 } // namespace blink |
| OLD | NEW |