| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // the binding and the dialog, and ask to be deleted. | 261 // the binding and the dialog, and ask to be deleted. |
| 262 client_.reset(); | 262 client_.reset(); |
| 263 binding_.Close(); | 263 binding_.Close(); |
| 264 delegate_->CloseDialog(); | 264 delegate_->CloseDialog(); |
| 265 if (observer_for_testing_) | 265 if (observer_for_testing_) |
| 266 observer_for_testing_->OnConnectionTerminated(); | 266 observer_for_testing_->OnConnectionTerminated(); |
| 267 manager_->DestroyRequest(this); | 267 manager_->DestroyRequest(this); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void PaymentRequest::Pay() { | 270 void PaymentRequest::Pay() { |
| 271 journey_logger_.SetSelectedPaymentMethod( |
| 272 JourneyLogger::SELECTED_PAYMENT_METHOD_CREDIT_CARD); |
| 271 state_->GeneratePaymentResponse(); | 273 state_->GeneratePaymentResponse(); |
| 272 } | 274 } |
| 273 | 275 |
| 274 void PaymentRequest::RecordFirstCompletionStatus( | 276 void PaymentRequest::RecordFirstCompletionStatus( |
| 275 JourneyLogger::CompletionStatus completion_status) { | 277 JourneyLogger::CompletionStatus completion_status) { |
| 276 if (!has_recorded_abort_reason_) { | 278 if (!has_recorded_abort_reason_) { |
| 277 has_recorded_abort_reason_ = true; | 279 has_recorded_abort_reason_ = true; |
| 278 // TODO(crbug.com/716546): Record more abort reasons. | 280 // TODO(crbug.com/716546): Record more abort reasons. |
| 279 if (completion_status == JourneyLogger::COMPLETION_STATUS_USER_ABORTED) { | 281 if (completion_status == JourneyLogger::COMPLETION_STATUS_USER_ABORTED) { |
| 280 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_ABORTED_BY_USER); | 282 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_ABORTED_BY_USER); |
| 281 } else { | 283 } else { |
| 282 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_OTHER); | 284 journey_logger_.SetAborted(JourneyLogger::ABORT_REASON_OTHER); |
| 283 } | 285 } |
| 284 } | 286 } |
| 285 } | 287 } |
| 286 | 288 |
| 287 } // namespace payments | 289 } // namespace payments |
| OLD | NEW |