| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/payments/content/utility/payment_manifest_parser.h" | 5 #include "components/payments/content/utility/payment_manifest_parser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "components/payments/content/utility/fingerprint_parser.h" | 17 #include "components/payments/content/utility/fingerprint_parser.h" |
| 18 #include "mojo/public/cpp/bindings/strong_binding.h" | 18 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 19 #include "url/url_constants.h" | 19 #include "url/url_constants.h" |
| 20 | 20 |
| 21 namespace payments { | 21 namespace payments { |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 void PaymentManifestParser::Create( | 24 void PaymentManifestParser::Create( |
| 25 const service_manager::BindSourceInfo& source_info, |
| 25 mojom::PaymentManifestParserRequest request) { | 26 mojom::PaymentManifestParserRequest request) { |
| 26 mojo::MakeStrongBinding(base::MakeUnique<PaymentManifestParser>(), | 27 mojo::MakeStrongBinding(base::MakeUnique<PaymentManifestParser>(), |
| 27 std::move(request)); | 28 std::move(request)); |
| 28 } | 29 } |
| 29 | 30 |
| 30 // static | 31 // static |
| 31 std::vector<GURL> PaymentManifestParser::ParsePaymentMethodManifestIntoVector( | 32 std::vector<GURL> PaymentManifestParser::ParsePaymentMethodManifestIntoVector( |
| 32 const std::string& input) { | 33 const std::string& input) { |
| 33 std::vector<GURL> output; | 34 std::vector<GURL> output; |
| 34 std::unique_ptr<base::Value> value(base::JSONReader::Read(input)); | 35 std::unique_ptr<base::Value> value(base::JSONReader::Read(input)); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 callback.Run(ParsePaymentMethodManifestIntoVector(content)); | 184 callback.Run(ParsePaymentMethodManifestIntoVector(content)); |
| 184 } | 185 } |
| 185 | 186 |
| 186 void PaymentManifestParser::ParseWebAppManifest( | 187 void PaymentManifestParser::ParseWebAppManifest( |
| 187 const std::string& content, | 188 const std::string& content, |
| 188 const ParseWebAppManifestCallback& callback) { | 189 const ParseWebAppManifestCallback& callback) { |
| 189 callback.Run(ParseWebAppManifestIntoVector(content)); | 190 callback.Run(ParseWebAppManifestIntoVector(content)); |
| 190 } | 191 } |
| 191 | 192 |
| 192 } // namespace payments | 193 } // namespace payments |
| OLD | NEW |