| 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 18 matching lines...) Expand all Loading... |
| 29 mojo::InterfaceRequest<mojom::PaymentRequest> request, | 29 mojo::InterfaceRequest<mojom::PaymentRequest> request, |
| 30 ObserverForTest* observer_for_testing) | 30 ObserverForTest* observer_for_testing) |
| 31 : web_contents_(web_contents), | 31 : web_contents_(web_contents), |
| 32 delegate_(std::move(delegate)), | 32 delegate_(std::move(delegate)), |
| 33 manager_(manager), | 33 manager_(manager), |
| 34 binding_(this, std::move(request)), | 34 binding_(this, std::move(request)), |
| 35 frame_origin_(GURL(render_frame_host->GetLastCommittedURL()).GetOrigin()), | 35 frame_origin_(GURL(render_frame_host->GetLastCommittedURL()).GetOrigin()), |
| 36 observer_for_testing_(observer_for_testing), | 36 observer_for_testing_(observer_for_testing), |
| 37 journey_logger_(delegate_->IsIncognito(), | 37 journey_logger_(delegate_->IsIncognito(), |
| 38 web_contents_->GetLastCommittedURL(), | 38 web_contents_->GetLastCommittedURL(), |
| 39 delegate_->GetUkmService()) { | 39 delegate_->GetUkmRecorder()) { |
| 40 // OnConnectionTerminated will be called when the Mojo pipe is closed. This | 40 // OnConnectionTerminated will be called when the Mojo pipe is closed. This |
| 41 // will happen as a result of many renderer-side events (both successful and | 41 // will happen as a result of many renderer-side events (both successful and |
| 42 // erroneous in nature). | 42 // erroneous in nature). |
| 43 // TODO(crbug.com/683636): Investigate using | 43 // TODO(crbug.com/683636): Investigate using |
| 44 // set_connection_error_with_reason_handler with Binding::CloseWithReason. | 44 // set_connection_error_with_reason_handler with Binding::CloseWithReason. |
| 45 binding_.set_connection_error_handler(base::Bind( | 45 binding_.set_connection_error_handler(base::Bind( |
| 46 &PaymentRequest::OnConnectionTerminated, base::Unretained(this))); | 46 &PaymentRequest::OnConnectionTerminated, base::Unretained(this))); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PaymentRequest::~PaymentRequest() {} | 49 PaymentRequest::~PaymentRequest() {} |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 void PaymentRequest::RecordFirstCompletionStatus( | 275 void PaymentRequest::RecordFirstCompletionStatus( |
| 276 JourneyLogger::CompletionStatus completion_status) { | 276 JourneyLogger::CompletionStatus completion_status) { |
| 277 if (!has_recorded_abort_reason_) { | 277 if (!has_recorded_abort_reason_) { |
| 278 has_recorded_abort_reason_ = true; | 278 has_recorded_abort_reason_ = true; |
| 279 journey_logger_.RecordJourneyStatsHistograms(completion_status); | 279 journey_logger_.RecordJourneyStatsHistograms(completion_status); |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace payments | 283 } // namespace payments |
| OLD | NEW |