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") {
deps = [
"//base",
"//components/signin/core/browser",
"//components/unified_consent",
"//components/version_info",
"//ios/chrome/app:tests_hook",
"//ios/chrome/app/strings",
......
......@@ -9,6 +9,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/version.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/unified_consent/feature.h"
#include "components/version_info/version_info.h"
#include "ios/chrome/app/tests_hook.h"
#import "ios/chrome/browser/browser_state/chrome_browser_state.h"
......@@ -110,18 +111,23 @@ NSSet* GaiaIdSetWithIdentities(NSArray* identities) {
- (void)dismissWithSignedIn:(BOOL)signedIn
showAccountsSettings:(BOOL)showAccountsSettings {
DCHECK(self.presentingViewController);
ProceduralBlock completion = nil;
if (showAccountsSettings) {
__weak UIViewController* presentingViewController =
self.presentingViewController;
__weak id<ApplicationCommands> weakDispatcher = self.dispatcher;
[presentingViewController
dismissViewControllerAnimated:YES
completion:^{
if (showAccountsSettings) {
[weakDispatcher
showAccountsSettingsFromViewController:
__weak id<ApplicationCommands> dispatcher = self.dispatcher;
completion = ^{
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
[dispatcher showAdvancedSigninSettingsFromViewController:
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
......
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