Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: ios/chrome/browser/payments/payment_request.mm

Issue 2970013003: [Payment Request] Displays appropriate footer if first transaction completed (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 =
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698