Commit 7336385f authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Removing pre-unity code from settings

Removing pre-unity code from settings.

Bug: 951313
Change-Id: I3249ca78d3bf80dd728040912e83afeb97be2369
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798709Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701048}
parent d9331731
...@@ -222,9 +222,6 @@ locale. The strings in this file are specific to iOS. ...@@ -222,9 +222,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN" desc="The title of the Import Data settings screen when signing in. [30em]"> <message name="IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN" desc="The title of the Import Data settings screen when signing in. [30em]">
Sign in to Chromium Sign in to Chromium
</message> </message>
<message name="IDS_IOS_OPTIONS_PRIVACY_FOOTER" desc="Footer for the clear browsing data dialog [Length: 300em] [iOS only]">
Chromium may use web services to improve your browsing experience. You may optionally disable these services. <ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph>
</message>
<message name="IDS_IOS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY" desc="The text of the identity section for iOS."> <message name="IDS_IOS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY" desc="The text of the identity section for iOS.">
Chromium verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate. Chromium verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate.
</message> </message>
...@@ -282,9 +279,6 @@ locale. The strings in this file are specific to iOS. ...@@ -282,9 +279,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_UPGRADE_AVAILABLE" desc="Text to inform the user of the presence of a new version of the application"> <message name="IDS_IOS_UPGRADE_AVAILABLE" desc="Text to inform the user of the presence of a new version of the application">
Chromium just got better! A new version is available. Chromium just got better! A new version is available.
</message> </message>
<message name="IDS_IOS_SIGNIN_PROMO_SETTINGS" desc="Text to inform the user that they can sign in to get personal settings">
Sign in to Chromium to get your bookmarks, passwords, and more on all your devices.
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
...@@ -222,9 +222,6 @@ locale. The strings in this file are specific to iOS. ...@@ -222,9 +222,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN" desc="The title of the Import Data settings screen when signing in. [30em]"> <message name="IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN" desc="The title of the Import Data settings screen when signing in. [30em]">
Sign in to Chrome Sign in to Chrome
</message> </message>
<message name="IDS_IOS_OPTIONS_PRIVACY_FOOTER" desc="Footer for the clear browsing data dialog [Length: 300em] [iOS only]">
Google Chrome may use web services to improve your browsing experience. You may optionally disable these services. <ph name="BEGIN_LINK">BEGIN_LINK</ph>Learn more<ph name="END_LINK">END_LINK</ph>
</message>
<message name="IDS_IOS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY" desc="The text of the identity section for iOS."> <message name="IDS_IOS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY" desc="The text of the identity section for iOS.">
Chrome verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate. Chrome verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate.
</message> </message>
...@@ -282,9 +279,6 @@ locale. The strings in this file are specific to iOS. ...@@ -282,9 +279,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_UPGRADE_AVAILABLE" desc="Text to inform the user of the presence of a new version of the application"> <message name="IDS_IOS_UPGRADE_AVAILABLE" desc="Text to inform the user of the presence of a new version of the application">
Chrome just got better! A new version is available. Chrome just got better! A new version is available.
</message> </message>
<message name="IDS_IOS_SIGNIN_PROMO_SETTINGS" desc="Text to inform the user that they can sign in to get personal settings">
Sign in to Chrome to get your bookmarks, passwords, and more on all your devices.
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
...@@ -1081,12 +1081,6 @@ Handoff must also be enabled in the General section of Settings, and your device ...@@ -1081,12 +1081,6 @@ Handoff must also be enabled in the General section of Settings, and your device
<message name="IDS_IOS_OPTIONS_REPORT_AN_ISSUE" desc="Title for the option on Settings page to report an issue. [Length: 20em] [iOS only]"> <message name="IDS_IOS_OPTIONS_REPORT_AN_ISSUE" desc="Title for the option on Settings page to report an issue. [Length: 20em] [iOS only]">
Report an Issue Report an Issue
</message> </message>
<message name="IDS_IOS_OPTIONS_SEARCH_URL_SUGGESTIONS" desc="Title for the option to turn on/off search and URL suggestions. [Length: 18em] [iOS only]">
Search and Site Suggestions
</message>
<message name="IDS_IOS_OPTIONS_SEND_USAGE_DATA" desc="Title for opening the setting for if/when to send usage data and crash reports. [Length: 20em] [iOS only]">
Send Usage Data
</message>
<message name="IDS_IOS_OPTIONS_WEB_SERVICES_LABEL" desc="Title for group of web services items in Privacy settings table, including Show Suggestions, Preload Webpages, and Send Usage Data. [Length: 10em] [iOS only]"> <message name="IDS_IOS_OPTIONS_WEB_SERVICES_LABEL" desc="Title for group of web services items in Privacy settings table, including Show Suggestions, Preload Webpages, and Send Usage Data. [Length: 10em] [iOS only]">
Web Services Web Services
</message> </message>
...@@ -1600,9 +1594,6 @@ Handoff must also be enabled in the General section of Settings, and your device ...@@ -1600,9 +1594,6 @@ Handoff must also be enabled in the General section of Settings, and your device
<message name="IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SUBTITLE" desc="The subtitle for the setting item to Sign in to Chrome [iOS only]"> <message name="IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SUBTITLE" desc="The subtitle for the setting item to Sign in to Chrome [iOS only]">
Get your bookmarks, history, passwords, and other settings on all your devices Get your bookmarks, history, passwords, and other settings on all your devices
</message> </message>
<message name="IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNCING" desc="The subtitle for the setting item of the signed in user [iOS only]">
Syncing to <ph name="EMAIL">$1<ex>john.doe@gmail.com</ex></ph>
</message>
<message name="IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNC_OFF" desc="The subtitle for the setting item of the signed in user when sync is off [iOS only]"> <message name="IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNC_OFF" desc="The subtitle for the setting item of the signed in user when sync is off [iOS only]">
Sync is off Sync is off
</message> </message>
......
...@@ -28,7 +28,6 @@ source_set("settings_root") { ...@@ -28,7 +28,6 @@ source_set("settings_root") {
"//ios/chrome/browser/ui/table_view", "//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/table_view:styler", "//ios/chrome/browser/ui/table_view:styler",
"//ios/chrome/browser/ui/table_view/cells", "//ios/chrome/browser/ui/table_view/cells",
"//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors", "//ios/chrome/common/colors",
"//ios/chrome/common/ui_util", "//ios/chrome/common/ui_util",
"//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser",
...@@ -103,12 +102,10 @@ source_set("settings") { ...@@ -103,12 +102,10 @@ source_set("settings") {
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
"//components/content_settings/core/common", "//components/content_settings/core/common",
"//components/feature_engagement", "//components/feature_engagement",
"//components/google/core/common",
"//components/handoff", "//components/handoff",
"//components/history/core/browser", "//components/history/core/browser",
"//components/image_fetcher/ios", "//components/image_fetcher/ios",
"//components/keyed_service/core", "//components/keyed_service/core",
"//components/metrics",
"//components/password_manager/core/browser", "//components/password_manager/core/browser",
"//components/password_manager/core/common", "//components/password_manager/core/common",
"//components/payments/core", "//components/payments/core",
...@@ -120,8 +117,6 @@ source_set("settings") { ...@@ -120,8 +117,6 @@ source_set("settings") {
"//components/strings", "//components/strings",
"//components/translate/core/browser", "//components/translate/core/browser",
"//components/translate/core/common", "//components/translate/core/common",
"//components/ukm/ios:features",
"//components/unified_consent",
"//components/url_formatter", "//components/url_formatter",
"//components/version_info", "//components/version_info",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
...@@ -265,7 +260,6 @@ source_set("unit_tests") { ...@@ -265,7 +260,6 @@ source_set("unit_tests") {
"//base/test:test_support", "//base/test:test_support",
"//components/autofill/core/common", "//components/autofill/core/common",
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
"//components/google/core/common",
"//components/handoff", "//components/handoff",
"//components/language/core/browser", "//components/language/core/browser",
"//components/password_manager/core/browser:test_support", "//components/password_manager/core/browser:test_support",
...@@ -279,8 +273,6 @@ source_set("unit_tests") { ...@@ -279,8 +273,6 @@ source_set("unit_tests") {
"//components/sync_preferences:test_support", "//components/sync_preferences:test_support",
"//components/translate/core/browser", "//components/translate/core/browser",
"//components/translate/core/common", "//components/translate/core/common",
"//components/ukm/ios:features",
"//components/unified_consent",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
"//ios/chrome/browser", "//ios/chrome/browser",
"//ios/chrome/browser/browser_state", "//ios/chrome/browser/browser_state",
...@@ -304,7 +296,6 @@ source_set("unit_tests") { ...@@ -304,7 +296,6 @@ source_set("unit_tests") {
"//ios/chrome/browser/ui/settings/cells", "//ios/chrome/browser/ui/settings/cells",
"//ios/chrome/browser/ui/table_view", "//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/table_view:test_support", "//ios/chrome/browser/ui/table_view:test_support",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/voice", "//ios/chrome/browser/voice",
"//ios/chrome/browser/web", "//ios/chrome/browser/web",
"//ios/chrome/browser/web:test_support", "//ios/chrome/browser/web:test_support",
...@@ -351,8 +342,6 @@ source_set("eg_tests") { ...@@ -351,8 +342,6 @@ source_set("eg_tests") {
"//components/prefs", "//components/prefs",
"//components/search_engines", "//components/search_engines",
"//components/strings", "//components/strings",
"//components/ukm/ios:features",
"//components/unified_consent",
"//ios/chrome/app:app_internal", "//ios/chrome/app:app_internal",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
"//ios/chrome/app/theme", "//ios/chrome/app/theme",
...@@ -370,8 +359,6 @@ source_set("eg_tests") { ...@@ -370,8 +359,6 @@ source_set("eg_tests") {
"//ios/chrome/browser/ui/authentication/cells", "//ios/chrome/browser/ui/authentication/cells",
"//ios/chrome/browser/ui/settings:test_support", "//ios/chrome/browser/ui/settings:test_support",
"//ios/chrome/browser/ui/table_view/cells", "//ios/chrome/browser/ui/table_view/cells",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/ui/util:util",
"//ios/chrome/test:eg_test_support", "//ios/chrome/test:eg_test_support",
"//ios/chrome/test:test_support", "//ios/chrome/test:test_support",
"//ios/chrome/test/app:test_support", "//ios/chrome/test/app:test_support",
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/sync_preferences/pref_service_mock_factory.h" #include "components/sync_preferences/pref_service_mock_factory.h"
#include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable.h"
#include "components/ukm/ios/features.h"
#include "components/unified_consent/feature.h"
#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
...@@ -95,9 +93,7 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) { ...@@ -95,9 +93,7 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) {
EXPECT_EQ(2, NumberOfSections()); EXPECT_EQ(2, NumberOfSections());
// Sections[0]. // Sections[0].
const int kExpectedNumberOfItermsInSection0 = EXPECT_EQ(2, NumberOfItemsInSection(0));
unified_consent::IsUnifiedConsentFeatureEnabled() ? 2 : 4;
EXPECT_EQ(kExpectedNumberOfItermsInSection0, NumberOfItemsInSection(0));
NSString* handoffSubtitle = chrome_browser_state_->GetPrefs()->GetBoolean( NSString* handoffSubtitle = chrome_browser_state_->GetPrefs()->GetBoolean(
prefs::kIosHandoffToOtherDevices) prefs::kIosHandoffToOtherDevices)
? l10n_util::GetNSString(IDS_IOS_SETTING_ON) ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
...@@ -109,19 +105,6 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) { ...@@ -109,19 +105,6 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) {
NO, l10n_util::GetNSString(IDS_SETTINGS_CAN_MAKE_PAYMENT_TOGGLE_LABEL), 0, NO, l10n_util::GetNSString(IDS_SETTINGS_CAN_MAKE_PAYMENT_TOGGLE_LABEL), 0,
1); 1);
if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
if (base::FeatureList::IsEnabled(kUmaCellular)) {
CheckSwitchCellStateAndTextWithId(NO, IDS_IOS_OPTIONS_SEND_USAGE_DATA, 0,
2);
} else {
CheckDetailItemTextWithIds(IDS_IOS_OPTIONS_SEND_USAGE_DATA,
IDS_IOS_OPTIONS_DATA_USAGE_NEVER, 0, 2);
}
CheckSwitchCellStateAndTextWithId(
YES, IDS_IOS_OPTIONS_SEARCH_URL_SUGGESTIONS, 0, 3);
CheckSectionFooterWithId(IDS_IOS_OPTIONS_PRIVACY_FOOTER, 0);
}
// Sections[1]. // Sections[1].
EXPECT_EQ(1, NumberOfItemsInSection(1)); EXPECT_EQ(1, NumberOfItemsInSection(1));
CheckTextCellText(l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_TITLE), CheckTextCellText(l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_TITLE),
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "components/prefs/pref_member.h" #include "components/prefs/pref_member.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/unified_consent/feature.h"
#import "ios/chrome/app/main_controller.h" #import "ios/chrome/app/main_controller.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h" #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h"
...@@ -75,10 +74,6 @@ enum MetricsServiceType { ...@@ -75,10 +74,6 @@ enum MetricsServiceType {
kBreakpadFirstLaunch, kBreakpadFirstLaunch,
}; };
// Matcher for the Send Usage Data cell on the Privacy screen.
id<GREYMatcher> SendUsageDataButton() {
return ButtonWithAccessibilityLabelId(IDS_IOS_OPTIONS_SEND_USAGE_DATA);
}
// Matcher for the Clear Browsing Data cell on the Privacy screen. // Matcher for the Clear Browsing Data cell on the Privacy screen.
id<GREYMatcher> ClearBrowsingDataCell() { id<GREYMatcher> ClearBrowsingDataCell() {
return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BROWSING_DATA_TITLE); return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BROWSING_DATA_TITLE);
...@@ -721,20 +716,11 @@ id<GREYMatcher> BandwidthSettingsButton() { ...@@ -721,20 +716,11 @@ id<GREYMatcher> BandwidthSettingsButton() {
GREYAssertNil(settings.keyCommands, GREYAssertNil(settings.keyCommands,
@"Settings should not register key commands when presented."); @"Settings should not register key commands when presented.");
// Dismiss the Sign-in UI. // Cancel the sign-in operation.
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { [[EarlGrey selectElementWithMatcher:
// Cancel the sign-in operation. grey_buttonTitle([l10n_util::GetNSString(
[[EarlGrey selectElementWithMatcher: IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON)
grey_buttonTitle([l10n_util::GetNSString( uppercaseString])] performAction:grey_tap()];
IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON)
uppercaseString])] performAction:grey_tap()];
} else {
// Cancel the add account operation.
[[EarlGrey
selectElementWithMatcher:grey_allOf(grey_buttonTitle(@"Cancel"),
grey_sufficientlyVisible(), nil)]
performAction:grey_tap()];
}
// Wait for UI to finish closing the Sign-in screen. // Wait for UI to finish closing the Sign-in screen.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
...@@ -744,20 +730,4 @@ id<GREYMatcher> BandwidthSettingsButton() { ...@@ -744,20 +730,4 @@ id<GREYMatcher> BandwidthSettingsButton() {
@"Settings should register key commands when presented."); @"Settings should register key commands when presented.");
} }
// Verifies the UI elements are accessible on the Send Usage Data page.
- (void)testAccessibilityOnSendUsageData {
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
EARL_GREY_TEST_DISABLED(
@"Privacy switch for ContentSuggestion was moved to the Sync and "
"Google services settings screen, so it is no longer present in the "
"privacy section. This test is now covered by "
"-[GoogleServicesSettingsTestCase testOpeningServices].");
}
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsMenuPrivacyButton()];
[ChromeEarlGreyUI tapPrivacyMenuButton:SendUsageDataButton()];
[ChromeEarlGrey verifyAccessibilityForCurrentScreen];
[self closeSubSettingsMenu];
}
@end @end
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#import "components/signin/public/identity_manager/objc/identity_manager_observer_bridge.h" #import "components/signin/public/identity_manager/objc/identity_manager_observer_bridge.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/unified_consent/feature.h"
#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
...@@ -383,15 +382,13 @@ NSString* kDevViewSourceKey = @"DevViewSource"; ...@@ -383,15 +382,13 @@ NSString* kDevViewSourceKey = @"DevViewSource";
[model addItem:[self accountCellItem] [model addItem:[self accountCellItem]
toSectionWithIdentifier:SectionIdentifierAccount]; toSectionWithIdentifier:SectionIdentifierAccount];
} }
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { if (![model hasSectionForSectionIdentifier:SectionIdentifierAccount]) {
if (![model hasSectionForSectionIdentifier:SectionIdentifierAccount]) { // Add the Account section for the Google services cell, if the user is
// Add the Account section for the Google services cell, if the user is // signed-out.
// signed-out. [model addSectionWithIdentifier:SectionIdentifierAccount];
[model addSectionWithIdentifier:SectionIdentifierAccount];
}
[model addItem:[self googleServicesCellItem]
toSectionWithIdentifier:SectionIdentifierAccount];
} }
[model addItem:[self googleServicesCellItem]
toSectionWithIdentifier:SectionIdentifierAccount];
// Basics section // Basics section
[model addSectionWithIdentifier:SectionIdentifierBasics]; [model addSectionWithIdentifier:SectionIdentifierBasics];
...@@ -454,13 +451,8 @@ NSString* kDevViewSourceKey = @"DevViewSource"; ...@@ -454,13 +451,8 @@ NSString* kDevViewSourceKey = @"DevViewSource";
if (_signinPromoViewMediator) { if (_signinPromoViewMediator) {
TableViewSigninPromoItem* signinPromoItem = TableViewSigninPromoItem* signinPromoItem =
[[TableViewSigninPromoItem alloc] initWithType:ItemTypeSigninPromo]; [[TableViewSigninPromoItem alloc] initWithType:ItemTypeSigninPromo];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { signinPromoItem.text =
signinPromoItem.text = l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS_WITH_UNITY);
l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS_WITH_UNITY);
} else {
signinPromoItem.text =
l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS);
}
signinPromoItem.configurator = signinPromoItem.configurator =
[_signinPromoViewMediator createConfigurator]; [_signinPromoViewMediator createConfigurator];
signinPromoItem.delegate = _signinPromoViewMediator; signinPromoItem.delegate = _signinPromoViewMediator;
...@@ -969,33 +961,7 @@ NSString* kDevViewSourceKey = @"DevViewSource"; ...@@ -969,33 +961,7 @@ NSString* kDevViewSourceKey = @"DevViewSource";
} }
identityAccountItem.image = [self userAccountImage]; identityAccountItem.image = [self userAccountImage];
identityAccountItem.text = [_identity userFullName]; identityAccountItem.text = [_identity userFullName];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { identityAccountItem.detailText = _identity.userEmail;
identityAccountItem.detailText = _identity.userEmail;
return;
}
SyncSetupService* syncSetupService =
SyncSetupServiceFactory::GetForBrowserState(_browserState);
if (!syncSetupService->HasFinishedInitialSetup()) {
identityAccountItem.detailText =
l10n_util::GetNSString(IDS_IOS_SYNC_SETUP_IN_PROGRESS);
identityAccountItem.shouldDisplayError = NO;
return;
}
identityAccountItem.shouldDisplayError =
!IsTransientSyncError(syncSetupService->GetSyncServiceState());
if (identityAccountItem.shouldDisplayError) {
identityAccountItem.detailText =
GetSyncErrorDescriptionForSyncSetupService(syncSetupService);
} else {
identityAccountItem.detailText =
syncSetupService->IsSyncEnabled()
? l10n_util::GetNSStringF(
IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNCING,
base::SysNSStringToUTF16([_identity userEmail]))
: l10n_util::GetNSString(
IDS_IOS_SIGN_IN_TO_CHROME_SETTING_SYNC_OFF);
}
} }
- (void)reloadAccountCell { - (void)reloadAccountCell {
...@@ -1138,11 +1104,7 @@ NSString* kDevViewSourceKey = @"DevViewSource"; ...@@ -1138,11 +1104,7 @@ NSString* kDevViewSourceKey = @"DevViewSource";
#pragma mark SyncObserverModelBridge #pragma mark SyncObserverModelBridge
- (void)onSyncStateChanged { - (void)onSyncStateChanged {
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { [self reloadGoogleServicesCell];
[self reloadGoogleServicesCell];
} else {
[self reloadAccountCell];
}
} }
#pragma mark - IdentityRefreshLogic #pragma mark - IdentityRefreshLogic
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/unified_consent/feature.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
...@@ -43,19 +42,11 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -43,19 +42,11 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState]; checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState];
[ChromeEarlGreyUI tapSettingsMenuButton:PrimarySignInButton()]; [ChromeEarlGreyUI tapSettingsMenuButton:PrimarySignInButton()];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { // Cancel the sign-in operation.
// Cancel the sign-in operation. [[EarlGrey selectElementWithMatcher:
[[EarlGrey selectElementWithMatcher: grey_buttonTitle([l10n_util::GetNSString(
grey_buttonTitle([l10n_util::GetNSString( IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON)
IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON) uppercaseString])] performAction:grey_tap()];
uppercaseString])] performAction:grey_tap()];
} else {
// Cancel the add account operation.
[[EarlGrey
selectElementWithMatcher:grey_allOf(grey_buttonTitle(@"Cancel"),
grey_sufficientlyVisible(), nil)]
performAction:grey_tap()];
}
[SigninEarlGreyUI [SigninEarlGreyUI
checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState]; checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState];
} }
......
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