| 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 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" | 5 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 AuthenticationServiceFactory::GetForBrowserState(_browserState); | 318 AuthenticationServiceFactory::GetForBrowserState(_browserState); |
| 319 if (!authService->IsAuthenticated()) { | 319 if (!authService->IsAuthenticated()) { |
| 320 if (!_hasRecordedSigninImpression) { | 320 if (!_hasRecordedSigninImpression) { |
| 321 // Once the Settings are open, this button impression will at most be | 321 // Once the Settings are open, this button impression will at most be |
| 322 // recorded once until they are closed. | 322 // recorded once until they are closed. |
| 323 base::RecordAction( | 323 base::RecordAction( |
| 324 base::UserMetricsAction("Signin_Impression_FromSettings")); | 324 base::UserMetricsAction("Signin_Impression_FromSettings")); |
| 325 _hasRecordedSigninImpression = YES; | 325 _hasRecordedSigninImpression = YES; |
| 326 } | 326 } |
| 327 if (experimental_flags::IsSigninPromoEnabled()) { | 327 if (experimental_flags::IsSigninPromoEnabled()) { |
| 328 _signinPromoViewMediator = [[SigninPromoViewMediator alloc] init]; | 328 _signinPromoViewMediator = |
| 329 [[SigninPromoViewMediator alloc] initWithBrowserState:_browserState]; |
| 329 _signinPromoViewMediator.consumer = self; | 330 _signinPromoViewMediator.consumer = self; |
| 330 } | 331 } |
| 331 [model addItem:[self signInTextItem] | 332 [model addItem:[self signInTextItem] |
| 332 toSectionWithIdentifier:SectionIdentifierSignIn]; | 333 toSectionWithIdentifier:SectionIdentifierSignIn]; |
| 333 } else { | 334 } else { |
| 334 _signinPromoViewMediator = nil; | 335 _signinPromoViewMediator = nil; |
| 335 [model addItem:[self accountCellItem] | 336 [model addItem:[self accountCellItem] |
| 336 toSectionWithIdentifier:SectionIdentifierSignIn]; | 337 toSectionWithIdentifier:SectionIdentifierSignIn]; |
| 337 } | 338 } |
| 338 | 339 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 (SigninPromoView*)signinPromoView { | 1171 (SigninPromoView*)signinPromoView { |
| 1171 DCHECK(_signinPromoViewMediator.defaultIdentity); | 1172 DCHECK(_signinPromoViewMediator.defaultIdentity); |
| 1172 base::RecordAction( | 1173 base::RecordAction( |
| 1173 base::UserMetricsAction("Signin_SigninNotDefault_FromSettings")); | 1174 base::UserMetricsAction("Signin_SigninNotDefault_FromSettings")); |
| 1174 [self showSignInWithIdentity:nil | 1175 [self showSignInWithIdentity:nil |
| 1175 promoAction:signin_metrics::PromoAction:: | 1176 promoAction:signin_metrics::PromoAction:: |
| 1176 PROMO_ACTION_NOT_DEFAULT]; | 1177 PROMO_ACTION_NOT_DEFAULT]; |
| 1177 } | 1178 } |
| 1178 | 1179 |
| 1179 @end | 1180 @end |
| OLD | NEW |