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

Side by Side Diff: ios/chrome/browser/ui/commands/show_signin_command.mm

Issue 2254813002: Remove SignInSource from ShowSigninCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@signin_source
Patch Set: Created 4 years, 4 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
« no previous file with comments | « ios/chrome/browser/ui/commands/show_signin_command.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ios/chrome/browser/ui/commands/show_signin_command.h" 5 #import "ios/chrome/browser/ui/commands/show_signin_command.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/scoped_block.h" 8 #include "base/mac/scoped_block.h"
9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" 9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
10 10
11 @implementation ShowSigninCommand { 11 @implementation ShowSigninCommand {
12 base::mac::ScopedBlock<ShowSigninCommandCompletionCallback> _callback; 12 base::mac::ScopedBlock<ShowSigninCommandCompletionCallback> _callback;
13 } 13 }
14 14
15 @synthesize operation = _operation; 15 @synthesize operation = _operation;
16 @synthesize signInSource = _signInSource;
17 @synthesize signInAccessPoint = _signInAccessPoint; 16 @synthesize signInAccessPoint = _signInAccessPoint;
18 17
19 - (instancetype)initWithTag:(NSInteger)tag { 18 - (instancetype)initWithTag:(NSInteger)tag {
20 NOTREACHED(); 19 NOTREACHED();
21 return nil; 20 return nil;
22 } 21 }
23 22
24 - (instancetype)initWithOperation:(AuthenticationOperation)operation 23 - (instancetype)initWithOperation:(AuthenticationOperation)operation
25 signInSource:(SignInSource)signInSource
26 callback:
27 (ShowSigninCommandCompletionCallback)callback {
28 if ((self = [super initWithTag:IDC_SHOW_SIGNIN_IOS])) {
29 _operation = operation;
30 _signInSource = signInSource;
31 _callback.reset(callback, base::scoped_policy::RETAIN);
32 }
33 return self;
34 }
35
36 - (instancetype)initWithOperation:(AuthenticationOperation)operation
37 signInSource:(SignInSource)signInSource {
38 return
39 [self initWithOperation:operation signInSource:signInSource callback:nil];
40 }
41
42 - (instancetype)initWithOperation:(AuthenticationOperation)operation
43 signInAccessPoint:(signin_metrics::AccessPoint)signInAccessPoint 24 signInAccessPoint:(signin_metrics::AccessPoint)signInAccessPoint
44 callback: 25 callback:
45 (ShowSigninCommandCompletionCallback)callback { 26 (ShowSigninCommandCompletionCallback)callback {
46 if ((self = [self initWithOperation:operation 27 if ((self = [super initWithTag:IDC_SHOW_SIGNIN_IOS])) {
47 signInSource:SIGN_IN_SOURCE_OTHER 28 _operation = operation;
48 callback:callback])) {
49 _signInAccessPoint = signInAccessPoint; 29 _signInAccessPoint = signInAccessPoint;
30 _callback.reset(callback, base::scoped_policy::RETAIN);
50 } 31 }
51 return self; 32 return self;
52 } 33 }
53 34
54 - (instancetype)initWithOperation:(AuthenticationOperation)operation 35 - (instancetype)initWithOperation:(AuthenticationOperation)operation
55 signInAccessPoint: 36 signInAccessPoint:
56 (signin_metrics::AccessPoint)signInAccessPoint { 37 (signin_metrics::AccessPoint)signInAccessPoint {
57 return [self initWithOperation:operation 38 return [self initWithOperation:operation
58 signInAccessPoint:signInAccessPoint 39 signInAccessPoint:signInAccessPoint
59 callback:nil]; 40 callback:nil];
60 } 41 }
61 42
62 - (ShowSigninCommandCompletionCallback)callback { 43 - (ShowSigninCommandCompletionCallback)callback {
63 return _callback.get(); 44 return _callback.get();
64 } 45 }
65 46
66 @end 47 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/commands/show_signin_command.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698