#include "third_party/blink/renderer/modules/on_device_translation/language_detector.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequenced_task_runner.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_language_detection_result.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_language_detector.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/language_detection/detect.h"
namespace blink {
LanguageDetector::LanguageDetector() = default;
void LanguageDetector::Trace(Visitor* visitor) const { … }
HeapVector<Member<LanguageDetectionResult>> ConvertResult(
WTF::Vector<LanguagePrediction> predictions) { … }
void OnDetectComplete(
ScriptPromiseResolver<IDLSequence<LanguageDetectionResult>>* resolver,
base::expected<WTF::Vector<LanguagePrediction>, DetectLanguageError>
result) { … }
ScriptPromise<IDLSequence<LanguageDetectionResult>> LanguageDetector::detect(
ScriptState* script_state,
const WTF::String& input,
ExceptionState& exception_state) { … }
}