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_state.h" | 5 #include "components/payments/content/payment_request_state.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return true; | 81 return true; |
82 } | 82 } |
83 } | 83 } |
84 return false; | 84 return false; |
85 } | 85 } |
86 | 86 |
87 bool PaymentRequestState::AreRequestedMethodsSupported() const { | 87 bool PaymentRequestState::AreRequestedMethodsSupported() const { |
88 return !spec_->supported_card_networks().empty(); | 88 return !spec_->supported_card_networks().empty(); |
89 } | 89 } |
90 | 90 |
| 91 std::string PaymentRequestState::GetAuthenticatedEmail() const { |
| 92 return payment_request_delegate_->GetAuthenticatedEmail(); |
| 93 } |
| 94 |
91 void PaymentRequestState::AddObserver(Observer* observer) { | 95 void PaymentRequestState::AddObserver(Observer* observer) { |
92 CHECK(observer); | 96 CHECK(observer); |
93 observers_.AddObserver(observer); | 97 observers_.AddObserver(observer); |
94 } | 98 } |
95 | 99 |
96 void PaymentRequestState::RemoveObserver(Observer* observer) { | 100 void PaymentRequestState::RemoveObserver(Observer* observer) { |
97 observers_.RemoveObserver(observer); | 101 observers_.RemoveObserver(observer); |
98 } | 102 } |
99 | 103 |
100 void PaymentRequestState::GeneratePaymentResponse() { | 104 void PaymentRequestState::GeneratePaymentResponse() { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 if (is_waiting_for_merchant_validation_) | 278 if (is_waiting_for_merchant_validation_) |
275 return false; | 279 return false; |
276 | 280 |
277 if (!profile_comparator()->IsShippingComplete(selected_shipping_profile_)) | 281 if (!profile_comparator()->IsShippingComplete(selected_shipping_profile_)) |
278 return false; | 282 return false; |
279 | 283 |
280 return profile_comparator()->IsContactInfoComplete(selected_contact_profile_); | 284 return profile_comparator()->IsContactInfoComplete(selected_contact_profile_); |
281 } | 285 } |
282 | 286 |
283 } // namespace payments | 287 } // namespace payments |
OLD | NEW |