blob: 98d193479a2c63e9b03def3b26240b05c01797fd [file] [log] [blame]
Yue Zhang32468b82023-10-31 18:09:191// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#import "components/commerce/ios/browser/web_extractor_impl.h"
6
7#import "base/strings/utf_string_conversions.h"
8#import "components/grit/components_resources.h"
9#import "ui/base/resource/resource_bundle.h"
10
11namespace commerce {
12
13WebExtractorImpl::WebExtractorImpl() = default;
14WebExtractorImpl::~WebExtractorImpl() = default;
15
16void WebExtractorImpl::ExtractMetaInfo(
17 WebWrapper* web_wrapper,
18 base::OnceCallback<void(const base::Value)> callback) {
19 std::string script =
20 ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(
21 IDR_QUERY_SHOPPING_META_JS);
22
23 web_wrapper->RunJavascript(base::UTF8ToUTF16(script), std::move(callback));
24}
25
26} // namespace commerce