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

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

Issue 2970013003: [Payment Request] Displays appropriate footer if first transaction completed (Closed)
Patch Set: Addressed comments + rebase 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
« no previous file with comments | « ios/chrome/browser/payments/BUILD.gn ('k') | ios/chrome/browser/payments/test_payment_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3885edb41feb6fa1fe4d4258cf40d3d8b8d62faf..091c41ceee644a6d9a158084b729eb4d60cda60a 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"
@@ -156,13 +159,16 @@ ukm::UkmRecorder* PaymentRequest::GetUkmRecorder() {
}
std::string PaymentRequest::GetAuthenticatedEmail() const {
- NOTREACHED() << "Implementation is never used";
- return std::string();
+ const SigninManager* signin_manager =
+ ios::SigninManagerFactory::GetForBrowserStateIfExists(browser_state_);
+ if (signin_manager && signin_manager->IsAuthenticated())
+ return signin_manager->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) {
« no previous file with comments | « ios/chrome/browser/payments/BUILD.gn ('k') | ios/chrome/browser/payments/test_payment_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698