Commit 5f3d09d3 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

Revert "[iOS] Updating enable/disable items in the Google Services settings"

This reverts commit 3b62417e.

Reason for revert: Suspecting this patch caused gclient runhooks failing on ios simulator. https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/ios-simulator-xcode-clang/58250

Original change's description:
> [iOS] Updating enable/disable items in the Google Services settings
> 
> "Google activity controls", "Encryption", and "Manage synced data..."
> is enabled when the user is authenticated and disabled otherwise.
> 
> Screenshot shared with Chromium accounts:
>   + Signed out:
> https://drive.google.com/open?id=19lXF2SdgpLdHUlTZ4WpxipDBdQNCshbU
>   + Signed in with consent accepted:
> https://drive.google.com/open?id=1SV3HhbG3hAbre5mSe06Dhjda4dJC4cck
>   + Signed in with consent not accepted:
> https://drive.google.com/open?id=1r5umMw6vf8yzh8X7V8V6LzRJVJLq8Rxs
> 
> Bug: 883101
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
> Change-Id: I3e2180c83f42adccb2717f2fdb96efa254751bbc
> Reviewed-on: https://chromium-review.googlesource.com/c/1290937
> Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
> Reviewed-by: Sergio Collazos <sczs@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#601537}

TBR=jlebel@chromium.org,sczs@chromium.org

Change-Id: Iac738ad46478cda09124b37b22b8936a8f8d7e20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 883101
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Reviewed-on: https://chromium-review.googlesource.com/c/1293758Reviewed-by: default avatarYi Gu <yigu@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601580}
parent def7399a
......@@ -611,9 +611,7 @@ textItemWithItemType:(NSInteger)itemType
BOOL enabled = self.isAuthenticated && !self.isConsentGiven;
[self updateSectionWithCollapsibleItem:self.syncPersonalizationItem
items:self.personalizedItems
collapsibleItemEnabled:enabled
switchItemEnabled:enabled
textItemEnabled:self.isAuthenticated];
enabled:enabled];
syncer::ModelType autofillModelType =
_syncSetupService->GetModelType(SyncSetupService::kSyncAutofill);
BOOL isAutofillOn = _syncSetupService->IsDataTypePreferred(autofillModelType);
......@@ -629,21 +627,16 @@ textItemWithItemType:(NSInteger)itemType
BOOL enabled = !self.isAuthenticated || !self.isConsentGiven;
[self updateSectionWithCollapsibleItem:self.nonPersonalizedServicesItem
items:self.nonPersonalizedItems
collapsibleItemEnabled:enabled
switchItemEnabled:enabled
textItemEnabled:enabled];
enabled:enabled];
}
// Updates |collapsibleItem| and |items| using |collapsibleItemEnabled|,
// |switchItemEnabled| and |textItemEnabled|.
// Set a section (collapsible item, with all the items inside) to be enabled
// or disabled.
- (void)updateSectionWithCollapsibleItem:
(SettingsCollapsibleItem*)collapsibleItem
items:(ItemArray)items
collapsibleItemEnabled:(BOOL)collapsibleItemEnabled
switchItemEnabled:(BOOL)switchItemEnabled
textItemEnabled:(BOOL)textItemEnabled {
UIColor* textColor =
collapsibleItemEnabled ? nil : [[MDCPalette greyPalette] tint500];
enabled:(BOOL)enabled {
UIColor* textColor = enabled ? nil : [[MDCPalette greyPalette] tint500];
collapsibleItem.textColor = textColor;
for (CollectionViewItem* item in items) {
if ([item isKindOfClass:[SyncSwitchItem class]]) {
......@@ -679,11 +672,11 @@ textItemWithItemType:(NSInteger)itemType
NOTREACHED();
break;
}
switchItem.enabled = switchItemEnabled;
switchItem.enabled = enabled;
} else if ([item isKindOfClass:[CollectionViewTextItem class]]) {
CollectionViewTextItem* textItem =
base::mac::ObjCCast<CollectionViewTextItem>(item);
textItem.enabled = textItemEnabled;
textItem.enabled = enabled;
} else {
NOTREACHED();
}
......
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