| 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 <utility> | 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 10 #include "components/payments/content/payment_details_validation.h" | 11 #include "components/payments/content/payment_details_validation.h" |
| 11 #include "components/payments/content/payment_request_web_contents_manager.h" | 12 #include "components/payments/content/payment_request_web_contents_manager.h" |
| 12 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 14 | 15 |
| 15 namespace payments { | 16 namespace payments { |
| 16 | 17 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 LOG(ERROR) << "Missing total"; | 53 LOG(ERROR) << "Missing total"; |
| 53 OnConnectionTerminated(); | 54 OnConnectionTerminated(); |
| 54 return; | 55 return; |
| 55 } | 56 } |
| 56 client_ = std::move(client); | 57 client_ = std::move(client); |
| 57 spec_ = base::MakeUnique<PaymentRequestSpec>( | 58 spec_ = base::MakeUnique<PaymentRequestSpec>( |
| 58 std::move(options), std::move(details), std::move(method_data), this, | 59 std::move(options), std::move(details), std::move(method_data), this, |
| 59 delegate_->GetApplicationLocale()); | 60 delegate_->GetApplicationLocale()); |
| 60 state_ = base::MakeUnique<PaymentRequestState>( | 61 state_ = base::MakeUnique<PaymentRequestState>( |
| 61 spec_.get(), this, delegate_->GetApplicationLocale(), | 62 spec_.get(), this, delegate_->GetApplicationLocale(), |
| 62 delegate_->GetPersonalDataManager()); | 63 delegate_->GetPersonalDataManager(), delegate_.get()); |
| 63 } | 64 } |
| 64 | 65 |
| 65 void PaymentRequest::Show() { | 66 void PaymentRequest::Show() { |
| 66 if (!client_.is_bound() || !binding_.is_bound()) { | 67 if (!client_.is_bound() || !binding_.is_bound()) { |
| 67 LOG(ERROR) << "Attempted Show(), but binding(s) missing."; | 68 LOG(ERROR) << "Attempted Show(), but binding(s) missing."; |
| 68 OnConnectionTerminated(); | 69 OnConnectionTerminated(); |
| 69 return; | 70 return; |
| 70 } | 71 } |
| 71 delegate_->ShowDialog(this); | 72 delegate_->ShowDialog(this); |
| 72 } | 73 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 binding_.Close(); | 158 binding_.Close(); |
| 158 delegate_->CloseDialog(); | 159 delegate_->CloseDialog(); |
| 159 manager_->DestroyRequest(this); | 160 manager_->DestroyRequest(this); |
| 160 } | 161 } |
| 161 | 162 |
| 162 void PaymentRequest::Pay() { | 163 void PaymentRequest::Pay() { |
| 163 state_->GeneratePaymentResponse(); | 164 state_->GeneratePaymentResponse(); |
| 164 } | 165 } |
| 165 | 166 |
| 166 } // namespace payments | 167 } // namespace payments |
| OLD | NEW |