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

Side by Side Diff: chrome/browser/payments/chrome_payment_request_delegate.cc

Issue 2883563002: Refactor UKM interface for mojo-ification (Closed)
Patch Set: Move interface to next CL Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" 10 #include "chrome/browser/autofill/personal_data_manager_factory.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 ChromePaymentRequestDelegate::GetRegionDataLoader() { 180 ChromePaymentRequestDelegate::GetRegionDataLoader() {
181 return new RegionDataLoaderImpl( 181 return new RegionDataLoaderImpl(
182 GetPersonalDataManager()->GetURLRequestContextGetter(), 182 GetPersonalDataManager()->GetURLRequestContextGetter(),
183 GetApplicationLocale()); 183 GetApplicationLocale());
184 } 184 }
185 185
186 AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() { 186 AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() {
187 return &address_normalizer_; 187 return &address_normalizer_;
188 } 188 }
189 189
190 ukm::UkmService* ChromePaymentRequestDelegate::GetUkmService() { 190 ukm::UkmRecorder* ChromePaymentRequestDelegate::GetUkmRecorder() {
191 return g_browser_process->ukm_service(); 191 return g_browser_process->ukm_recorder();
192 } 192 }
193 193
194 std::string ChromePaymentRequestDelegate::GetAuthenticatedEmail() const { 194 std::string ChromePaymentRequestDelegate::GetAuthenticatedEmail() const {
195 // Check if the profile is authenticated. Guest profiles or incognito 195 // Check if the profile is authenticated. Guest profiles or incognito
196 // windows may not have a sign in manager, and are considered not 196 // windows may not have a sign in manager, and are considered not
197 // authenticated. 197 // authenticated.
198 Profile* profile = 198 Profile* profile =
199 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 199 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
200 SigninManagerBase* signin_manager = 200 SigninManagerBase* signin_manager =
201 SigninManagerFactory::GetForProfile(profile); 201 SigninManagerFactory::GetForProfile(profile);
202 if (signin_manager && signin_manager->IsAuthenticated()) 202 if (signin_manager && signin_manager->IsAuthenticated())
203 return signin_manager->GetAuthenticatedAccountInfo().email; 203 return signin_manager->GetAuthenticatedAccountInfo().email;
204 204
205 return std::string(); 205 return std::string();
206 } 206 }
207 207
208 PrefService* ChromePaymentRequestDelegate::GetPrefService() { 208 PrefService* ChromePaymentRequestDelegate::GetPrefService() {
209 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()) 209 return Profile::FromBrowserContext(web_contents_->GetBrowserContext())
210 ->GetPrefs(); 210 ->GetPrefs();
211 } 211 }
212 212
213 } // namespace payments 213 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698