| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/authentication/chrome_signin_view_controller.h" | 5 #include "ios/chrome/browser/ui/authentication/chrome_signin_view_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 postSignInAction:POST_SIGNIN_ACTION_NONE | 351 postSignInAction:POST_SIGNIN_ACTION_NONE |
| 352 presentingViewController:self]); | 352 presentingViewController:self]); |
| 353 base::WeakNSObject<ChromeSigninViewController> weakSelf(self); | 353 base::WeakNSObject<ChromeSigninViewController> weakSelf(self); |
| 354 [_authenticationFlow startSignInWithCompletion:^(BOOL success) { | 354 [_authenticationFlow startSignInWithCompletion:^(BOOL success) { |
| 355 [weakSelf onAccountSigninCompletion:success]; | 355 [weakSelf onAccountSigninCompletion:success]; |
| 356 }]; | 356 }]; |
| 357 } | 357 } |
| 358 | 358 |
| 359 - (void)openAuthenticationDialogAddIdentity { | 359 - (void)openAuthenticationDialogAddIdentity { |
| 360 DCHECK(!_interactionManager); | 360 DCHECK(!_interactionManager); |
| 361 _interactionManager = | 361 _interactionManager.reset( |
| 362 ios::GetChromeBrowserProvider() | 362 ios::GetChromeBrowserProvider() |
| 363 ->GetChromeIdentityService() | 363 ->GetChromeIdentityService() |
| 364 ->NewChromeIdentityInteractionManager(_browserState, self); | 364 ->CreateChromeIdentityInteractionManager(_browserState, self)); |
| 365 base::WeakNSObject<ChromeSigninViewController> weakSelf(self); | 365 base::WeakNSObject<ChromeSigninViewController> weakSelf(self); |
| 366 SigninCompletionCallback completion = | 366 SigninCompletionCallback completion = |
| 367 ^(ChromeIdentity* identity, NSError* error) { | 367 ^(ChromeIdentity* identity, NSError* error) { |
| 368 base::scoped_nsobject<ChromeSigninViewController> strongSelf( | 368 base::scoped_nsobject<ChromeSigninViewController> strongSelf( |
| 369 [weakSelf retain]); | 369 [weakSelf retain]); |
| 370 if (!strongSelf || !strongSelf.get()->_interactionManager) | 370 if (!strongSelf || !strongSelf.get()->_interactionManager) |
| 371 return; | 371 return; |
| 372 // The ChromeIdentityInteractionManager is not used anymore at this | 372 // The ChromeIdentityInteractionManager is not used anymore at this |
| 373 // point. | 373 // point. |
| 374 strongSelf.get()->_interactionManager.reset(); | 374 strongSelf.get()->_interactionManager.reset(); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 } | 942 } |
| 943 _hasConfirmationScreenReachedBottom = YES; | 943 _hasConfirmationScreenReachedBottom = YES; |
| 944 [self setPrimaryButtonStyling:_primaryButton]; | 944 [self setPrimaryButtonStyling:_primaryButton]; |
| 945 [_primaryButton setTitle:[self acceptSigninButtonTitle] | 945 [_primaryButton setTitle:[self acceptSigninButtonTitle] |
| 946 forState:UIControlStateNormal]; | 946 forState:UIControlStateNormal]; |
| 947 [_primaryButton setImage:nil forState:UIControlStateNormal]; | 947 [_primaryButton setImage:nil forState:UIControlStateNormal]; |
| 948 [self.view setNeedsLayout]; | 948 [self.view setNeedsLayout]; |
| 949 } | 949 } |
| 950 | 950 |
| 951 @end | 951 @end |
| OLD | NEW |