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 "components/payments/content/payment_request.h" | 5 #include "components/payments/content/payment_request.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return; | 161 return; |
162 | 162 |
163 if (result != mojom::PaymentComplete::SUCCESS) { | 163 if (result != mojom::PaymentComplete::SUCCESS) { |
164 delegate_->ShowErrorMessage(); | 164 delegate_->ShowErrorMessage(); |
165 } else { | 165 } else { |
166 journey_logger_.RecordJourneyStatsHistograms( | 166 journey_logger_.RecordJourneyStatsHistograms( |
167 JourneyLogger::COMPLETION_STATUS_COMPLETED); | 167 JourneyLogger::COMPLETION_STATUS_COMPLETED); |
168 // When the renderer closes the connection, | 168 // When the renderer closes the connection, |
169 // PaymentRequest::OnConnectionTerminated will be called. | 169 // PaymentRequest::OnConnectionTerminated will be called. |
170 client_->OnComplete(); | 170 client_->OnComplete(); |
| 171 state_->RecordUseStats(); |
171 } | 172 } |
172 } | 173 } |
173 | 174 |
174 void PaymentRequest::CanMakePayment() { | 175 void PaymentRequest::CanMakePayment() { |
175 bool can_make_payment = state()->CanMakePayment(); | 176 bool can_make_payment = state()->CanMakePayment(); |
176 if (delegate_->IsIncognito()) { | 177 if (delegate_->IsIncognito()) { |
177 client_->OnCanMakePayment( | 178 client_->OnCanMakePayment( |
178 mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT); | 179 mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT); |
179 journey_logger_.SetCanMakePaymentValue(true); | 180 journey_logger_.SetCanMakePaymentValue(true); |
180 } else if (CanMakePaymentQueryFactory::GetInstance() | 181 } else if (CanMakePaymentQueryFactory::GetInstance() |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (observer_for_testing_) | 248 if (observer_for_testing_) |
248 observer_for_testing_->OnConnectionTerminated(); | 249 observer_for_testing_->OnConnectionTerminated(); |
249 manager_->DestroyRequest(this); | 250 manager_->DestroyRequest(this); |
250 } | 251 } |
251 | 252 |
252 void PaymentRequest::Pay() { | 253 void PaymentRequest::Pay() { |
253 state_->GeneratePaymentResponse(); | 254 state_->GeneratePaymentResponse(); |
254 } | 255 } |
255 | 256 |
256 } // namespace payments | 257 } // namespace payments |
OLD | NEW |