| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/payments/chrome_payment_request_delegate.h" | 5 #include "chrome/browser/payments/chrome_payment_request_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 10 #include "chrome/browser/autofill/validation_rules_storage_factory.h" | 10 #include "chrome/browser/autofill/validation_rules_storage_factory.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 GetAddressInputSource( | 106 GetAddressInputSource( |
| 107 GetPersonalDataManager()->GetURLRequestContextGetter()) | 107 GetPersonalDataManager()->GetURLRequestContextGetter()) |
| 108 .release(), | 108 .release(), |
| 109 GetAddressInputStorage().release(), GetApplicationLocale()); | 109 GetAddressInputStorage().release(), GetApplicationLocale()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() { | 112 AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() { |
| 113 return &address_normalizer_; | 113 return &address_normalizer_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 ukm::UkmService* ChromePaymentRequestDelegate::GetUkmService() { | 116 ukm::UkmRecorder* ChromePaymentRequestDelegate::GetUkmRecorder() { |
| 117 return g_browser_process->ukm_service(); | 117 return g_browser_process->ukm_recorder(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 std::string ChromePaymentRequestDelegate::GetAuthenticatedEmail() const { | 120 std::string ChromePaymentRequestDelegate::GetAuthenticatedEmail() const { |
| 121 // Check if the profile is authenticated. Guest profiles or incognito | 121 // Check if the profile is authenticated. Guest profiles or incognito |
| 122 // windows may not have a sign in manager, and are considered not | 122 // windows may not have a sign in manager, and are considered not |
| 123 // authenticated. | 123 // authenticated. |
| 124 Profile* profile = | 124 Profile* profile = |
| 125 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 125 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 126 SigninManagerBase* signin_manager = | 126 SigninManagerBase* signin_manager = |
| 127 SigninManagerFactory::GetForProfile(profile); | 127 SigninManagerFactory::GetForProfile(profile); |
| 128 if (signin_manager && signin_manager->IsAuthenticated()) | 128 if (signin_manager && signin_manager->IsAuthenticated()) |
| 129 return signin_manager->GetAuthenticatedAccountInfo().email; | 129 return signin_manager->GetAuthenticatedAccountInfo().email; |
| 130 | 130 |
| 131 return std::string(); | 131 return std::string(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 PrefService* ChromePaymentRequestDelegate::GetPrefService() { | 134 PrefService* ChromePaymentRequestDelegate::GetPrefService() { |
| 135 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()) | 135 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()) |
| 136 ->GetPrefs(); | 136 ->GetPrefs(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace payments | 139 } // namespace payments |
| OLD | NEW |