Chromium Code Reviews| Index: ios/chrome/browser/payments/payment_request.mm |
| diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm |
| index 406ba1e571fe95afe59983eb71142e9db87b298b..193c99d3a01ab619f7ff0743ec630fac62a12175 100644 |
| --- a/ios/chrome/browser/payments/payment_request.mm |
| +++ b/ios/chrome/browser/payments/payment_request.mm |
| @@ -18,10 +18,13 @@ |
| #include "components/payments/core/address_normalizer_impl.h" |
| #include "components/payments/core/currency_formatter.h" |
| #include "components/payments/core/payment_request_data_util.h" |
| +#include "components/prefs/pref_service.h" |
| +#include "components/signin/core/browser/signin_manager.h" |
| #include "ios/chrome/browser/application_context.h" |
| #include "ios/chrome/browser/autofill/validation_rules_storage_factory.h" |
| #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| #import "ios/chrome/browser/payments/payment_request_util.h" |
| +#include "ios/chrome/browser/signin/signin_manager_factory.h" |
| #include "ios/web/public/payments/payment_request.h" |
| #include "third_party/libaddressinput/chromium/chrome_metadata_source.h" |
| #include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" |
| @@ -152,13 +155,16 @@ ukm::UkmRecorder* PaymentRequest::GetUkmRecorder() { |
| } |
| std::string PaymentRequest::GetAuthenticatedEmail() const { |
| - NOTREACHED() << "Implementation is never used"; |
| - return std::string(); |
| + const SigninManager* signinManager = |
|
Eugene But (OOO till 7-30)
2017/07/05 14:47:31
s/signinManager/signin_manager
Moe
2017/07/05 16:01:46
Done.
|
| + ios::SigninManagerFactory::GetForBrowserStateIfExists(browser_state_); |
| + if (signinManager && signinManager->IsAuthenticated()) |
| + return signinManager->GetAuthenticatedAccountInfo().email; |
| + else |
| + return std::string(); |
| } |
| PrefService* PaymentRequest::GetPrefService() { |
| - NOTREACHED() << "Implementation is never used"; |
| - return nullptr; |
| + return browser_state_->GetPrefs(); |
| } |
| void PaymentRequest::UpdatePaymentDetails(const web::PaymentDetails& details) { |