| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 AuthenticationServiceFactory::GetForBrowserState(_mainBrowserState); | 329 AuthenticationServiceFactory::GetForBrowserState(_mainBrowserState); |
| 330 if (!authService->IsAuthenticated()) { | 330 if (!authService->IsAuthenticated()) { |
| 331 if (!_hasRecordedSigninImpression) { | 331 if (!_hasRecordedSigninImpression) { |
| 332 // Once the Settings are open, this button impression will at most be | 332 // Once the Settings are open, this button impression will at most be |
| 333 // recorded once until they are closed. | 333 // recorded once until they are closed. |
| 334 base::RecordAction( | 334 base::RecordAction( |
| 335 base::UserMetricsAction("Signin_Impression_FromSettings")); | 335 base::UserMetricsAction("Signin_Impression_FromSettings")); |
| 336 _hasRecordedSigninImpression = YES; | 336 _hasRecordedSigninImpression = YES; |
| 337 } | 337 } |
| 338 if (experimental_flags::IsSigninPromoEnabled()) { | 338 if (experimental_flags::IsSigninPromoEnabled()) { |
| 339 _signinPromoViewMediator = [[SigninPromoViewMediator alloc] init]; | 339 _signinPromoViewMediator = [[SigninPromoViewMediator alloc] |
| 340 initWithBrowserState:_currentBrowserState]; |
| 340 _signinPromoViewMediator.consumer = self; | 341 _signinPromoViewMediator.consumer = self; |
| 341 } | 342 } |
| 342 [model addItem:[self signInTextItem] | 343 [model addItem:[self signInTextItem] |
| 343 toSectionWithIdentifier:SectionIdentifierSignIn]; | 344 toSectionWithIdentifier:SectionIdentifierSignIn]; |
| 344 } else { | 345 } else { |
| 345 _signinPromoViewMediator = nil; | 346 _signinPromoViewMediator = nil; |
| 346 [model addItem:[self accountCellItem] | 347 [model addItem:[self accountCellItem] |
| 347 toSectionWithIdentifier:SectionIdentifierSignIn]; | 348 toSectionWithIdentifier:SectionIdentifierSignIn]; |
| 348 } | 349 } |
| 349 | 350 |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 (SigninPromoView*)signinPromoView { | 1200 (SigninPromoView*)signinPromoView { |
| 1200 DCHECK(_signinPromoViewMediator.defaultIdentity); | 1201 DCHECK(_signinPromoViewMediator.defaultIdentity); |
| 1201 base::RecordAction( | 1202 base::RecordAction( |
| 1202 base::UserMetricsAction("Signin_SigninNotDefault_FromSettings")); | 1203 base::UserMetricsAction("Signin_SigninNotDefault_FromSettings")); |
| 1203 [self showSignInWithIdentity:nil | 1204 [self showSignInWithIdentity:nil |
| 1204 promoAction:signin_metrics::PromoAction:: | 1205 promoAction:signin_metrics::PromoAction:: |
| 1205 PROMO_ACTION_NOT_DEFAULT]; | 1206 PROMO_ACTION_NOT_DEFAULT]; |
| 1206 } | 1207 } |
| 1207 | 1208 |
| 1208 @end | 1209 @end |
| OLD | NEW |