Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: components/payments/content/payment_request_spec.cc

Issue 2866623003: PaymentRequest.canMakePayment() query quota on desktop. (Closed)
Patch Set: frame Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/payments/content/payment_request_spec.h" 5 #include "components/payments/content/payment_request_spec.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 observer.OnStartUpdating(reason); 136 observer.OnStartUpdating(reason);
137 } 137 }
138 } 138 }
139 139
140 void PaymentRequestSpec::PopulateValidatedMethodData( 140 void PaymentRequestSpec::PopulateValidatedMethodData(
141 const std::vector<mojom::PaymentMethodDataPtr>& method_data_mojom) { 141 const std::vector<mojom::PaymentMethodDataPtr>& method_data_mojom) {
142 std::vector<PaymentMethodData> method_data_vector; 142 std::vector<PaymentMethodData> method_data_vector;
143 method_data_vector.reserve(method_data_mojom.size()); 143 method_data_vector.reserve(method_data_mojom.size());
144 for (const mojom::PaymentMethodDataPtr& method_data_entry : 144 for (const mojom::PaymentMethodDataPtr& method_data_entry :
145 method_data_mojom) { 145 method_data_mojom) {
146 for (const std::string& method : method_data_entry->supported_methods) {
147 stringified_method_data_[method].insert(
148 method_data_entry->stringified_data);
149 }
150
146 PaymentMethodData method_data; 151 PaymentMethodData method_data;
147 method_data.supported_methods = method_data_entry->supported_methods; 152 method_data.supported_methods = method_data_entry->supported_methods;
148 // Transfer the supported basic card networks. 153 // Transfer the supported basic card networks.
149 std::vector<std::string> supported_networks; 154 std::vector<std::string> supported_networks;
150 for (const mojom::BasicCardNetwork& network : 155 for (const mojom::BasicCardNetwork& network :
151 method_data_entry->supported_networks) { 156 method_data_entry->supported_networks) {
152 supported_networks.push_back(GetBasicCardNetworkName(network)); 157 supported_networks.push_back(GetBasicCardNetworkName(network));
153 } 158 }
154 method_data.supported_networks = std::move(supported_networks); 159 method_data.supported_networks = std::move(supported_networks);
155 160
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 const std::string& currency_system, 208 const std::string& currency_system,
204 const std::string& locale_name) { 209 const std::string& locale_name) {
205 if (!currency_formatter_) { 210 if (!currency_formatter_) {
206 currency_formatter_.reset( 211 currency_formatter_.reset(
207 new CurrencyFormatter(currency_code, currency_system, locale_name)); 212 new CurrencyFormatter(currency_code, currency_system, locale_name));
208 } 213 }
209 return currency_formatter_.get(); 214 return currency_formatter_.get();
210 } 215 }
211 216
212 } // namespace payments 217 } // namespace payments
OLDNEW
« no previous file with comments | « components/payments/content/payment_request_spec.h ('k') | components/payments/content/payment_request_web_contents_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698