Commit 3fe22318 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

[IOS] Fixes Passwords detail text color in Chrome Settings page

The root cause was that item of type ItemTypeSavedPasswords was not
being properly formatter in |-collectionView:cellForItemAtIndexPath:|

Also sets the detail text of the item at the time of creation, and not
only when the preference changes.

Bug: 882583
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I68a3d8660e520a99ec59b3fc48fb2f78dc59b5fe
Reviewed-on: https://chromium-review.googlesource.com/1217503Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590090}
parent c02048ed
...@@ -564,10 +564,15 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -564,10 +564,15 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
} }
- (CollectionViewItem*)savePasswordsDetailItem { - (CollectionViewItem*)savePasswordsDetailItem {
BOOL savePasswordsEnabled = _browserState->GetPrefs()->GetBoolean(
password_manager::prefs::kCredentialsEnableService);
NSString* passwordsDetail = savePasswordsEnabled
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
_savePasswordsDetailItem = _savePasswordsDetailItem =
[self detailItemWithType:ItemTypeSavedPasswords [self detailItemWithType:ItemTypeSavedPasswords
text:l10n_util::GetNSString(IDS_IOS_PASSWORDS) text:l10n_util::GetNSString(IDS_IOS_PASSWORDS)
detailText:nil detailText:passwordsDetail
iconImageName:kSettingsPasswordsImageName]; iconImageName:kSettingsPasswordsImageName];
return _savePasswordsDetailItem; return _savePasswordsDetailItem;
...@@ -777,12 +782,13 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -777,12 +782,13 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
detailCell.textLabel.textColor = [[MDCPalette greyPalette] tint500]; detailCell.textLabel.textColor = [[MDCPalette greyPalette] tint500];
detailCell.detailTextLabel.textColor = detailCell.detailTextLabel.textColor =
[[MDCPalette greyPalette] tint400]; [[MDCPalette greyPalette] tint400];
return cell;
} }
} else {
[detailCell setUserInteractionEnabled:YES];
detailCell.textLabel.textColor = [[MDCPalette greyPalette] tint900];
detailCell.detailTextLabel.textColor = [[MDCPalette greyPalette] tint500];
} }
[detailCell setUserInteractionEnabled:YES];
detailCell.textLabel.textColor = [[MDCPalette greyPalette] tint900];
detailCell.detailTextLabel.textColor = [[MDCPalette greyPalette] tint500];
} }
switch (itemType) { switch (itemType) {
...@@ -1286,7 +1292,6 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -1286,7 +1292,6 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
NSString* passwordsDetail = NSString* passwordsDetail =
savePasswordsEnabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) savePasswordsEnabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF); : l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
_savePasswordsDetailItem.detailText = passwordsDetail; _savePasswordsDetailItem.detailText = passwordsDetail;
[self reconfigureCellsForItems:@[ _savePasswordsDetailItem ]]; [self reconfigureCellsForItems:@[ _savePasswordsDetailItem ]];
} }
......
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