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

Side by Side Diff: ios/chrome/browser/ui/payments/payment_request_mediator.mm

Issue 2866793002: [Payment Request] Refactors PaymentRequestCoordinator. (Closed)
Patch Set: Reformats selector. 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ios/chrome/browser/ui/payments/payment_request_mediator.h"
6
7 #include "base/strings/sys_string_conversions.h"
8 #include "components/signin/core/browser/signin_manager.h"
9 #include "ios/chrome/browser/signin/signin_manager_factory.h"
10
11 @implementation PaymentRequestMediator {
12 ios::ChromeBrowserState* _browserState;
13 }
14
15 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState {
16 DCHECK(browserState);
17 self = [super init];
18 if (self) {
19 _browserState = browserState;
20 }
21 return self;
22 }
23
24 - (NSString*)authenticatedAccountName {
25 const SigninManager* signinManager =
26 ios::SigninManagerFactory::GetForBrowserStateIfExists(_browserState);
27 if (signinManager && signinManager->IsAuthenticated()) {
28 return base::SysUTF8ToNSString(
29 signinManager->GetAuthenticatedAccountInfo().email);
30 }
31 return nil;
32 }
33
34 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698