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