Commit f280cf36 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

Present the advanced sign-in settings from SigninPromoViewController.

This CL adds a temporary solution to present the advanced sign-in
settings when the user taps on settings on the sign-in promo screen.

This is a temporary solution as the plan is to move the ownership of
the SigninPromoViewController to the SigninInteractionCoordinator
(see crbug.com/965992). However it is preferred to only make this change
after the unified consent feature is launched as it is fairly complex to
do if we want to also support pre-unified consent flows.

Bug: 963412

Change-Id: Iee3216254e2b42dbaed39503af58851980a7c9bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1625110
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662647}
parent 471c3614
...@@ -12,6 +12,7 @@ source_set("promos") { ...@@ -12,6 +12,7 @@ source_set("promos") {
deps = [ deps = [
"//base", "//base",
"//components/signin/core/browser", "//components/signin/core/browser",
"//components/unified_consent",
"//components/version_info", "//components/version_info",
"//ios/chrome/app:tests_hook", "//ios/chrome/app:tests_hook",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/version.h" #include "base/version.h"
#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/browser/signin_metrics.h"
#include "components/unified_consent/feature.h"
#include "components/version_info/version_info.h" #include "components/version_info/version_info.h"
#include "ios/chrome/app/tests_hook.h" #include "ios/chrome/app/tests_hook.h"
#import "ios/chrome/browser/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/browser_state/chrome_browser_state.h"
...@@ -110,18 +111,23 @@ NSSet* GaiaIdSetWithIdentities(NSArray* identities) { ...@@ -110,18 +111,23 @@ NSSet* GaiaIdSetWithIdentities(NSArray* identities) {
- (void)dismissWithSignedIn:(BOOL)signedIn - (void)dismissWithSignedIn:(BOOL)signedIn
showAccountsSettings:(BOOL)showAccountsSettings { showAccountsSettings:(BOOL)showAccountsSettings {
DCHECK(self.presentingViewController); DCHECK(self.presentingViewController);
__weak UIViewController* presentingViewController = ProceduralBlock completion = nil;
self.presentingViewController; if (showAccountsSettings) {
__weak id<ApplicationCommands> weakDispatcher = self.dispatcher; __weak UIViewController* presentingViewController =
[presentingViewController self.presentingViewController;
dismissViewControllerAnimated:YES __weak id<ApplicationCommands> dispatcher = self.dispatcher;
completion:^{ completion = ^{
if (showAccountsSettings) { if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
[weakDispatcher [dispatcher showAdvancedSigninSettingsFromViewController:
showAccountsSettingsFromViewController: presentingViewController];
presentingViewController]; } else {
} [dispatcher
}]; showAccountsSettingsFromViewController:presentingViewController];
}
};
}
[self.presentingViewController dismissViewControllerAnimated:YES
completion:completion];
} }
// Records in user defaults that the promo has been shown as well as the number // Records in user defaults that the promo has been shown as well as the number
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment