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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 if (observer_for_testing_) | 252 if (observer_for_testing_) |
253 observer_for_testing_->OnConnectionTerminated(); | 253 observer_for_testing_->OnConnectionTerminated(); |
254 manager_->DestroyRequest(this); | 254 manager_->DestroyRequest(this); |
255 } | 255 } |
256 | 256 |
257 void PaymentRequest::Pay() { | 257 void PaymentRequest::Pay() { |
258 state_->GeneratePaymentResponse(); | 258 state_->GeneratePaymentResponse(); |
259 } | 259 } |
260 | 260 |
261 } // namespace payments | 261 } // namespace payments |
OLD | NEW |