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.
<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
</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.">
Chromium verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate.
</message>
......@@ -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">
Chromium just got better! A new version is available.
</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>
</release>
</grit>
......@@ -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]">
Sign in to Chrome
</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.">
Chrome verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate.
</message>
......@@ -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">
Chrome just got better! A new version is available.
</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>
</release>
</grit>
......@@ -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]">
Report an Issue
</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]">
Web Services
</message>
......@@ -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]">
Get your bookmarks, history, passwords, and other settings on all your devices
</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]">
Sync is off
</message>
......
......@@ -28,7 +28,6 @@ source_set("settings_root") {
"//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/table_view:styler",
"//ios/chrome/browser/ui/table_view/cells",
"//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors",
"//ios/chrome/common/ui_util",
"//ios/public/provider/chrome/browser",
......@@ -103,12 +102,10 @@ source_set("settings") {
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/feature_engagement",
"//components/google/core/common",
"//components/handoff",
"//components/history/core/browser",
"//components/image_fetcher/ios",
"//components/keyed_service/core",
"//components/metrics",
"//components/password_manager/core/browser",
"//components/password_manager/core/common",
"//components/payments/core",
......@@ -120,8 +117,6 @@ source_set("settings") {
"//components/strings",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/ukm/ios:features",
"//components/unified_consent",
"//components/url_formatter",
"//components/version_info",
"//ios/chrome/app/strings",
......@@ -265,7 +260,6 @@ source_set("unit_tests") {
"//base/test:test_support",
"//components/autofill/core/common",
"//components/content_settings/core/browser",
"//components/google/core/common",
"//components/handoff",
"//components/language/core/browser",
"//components/password_manager/core/browser:test_support",
......@@ -279,8 +273,6 @@ source_set("unit_tests") {
"//components/sync_preferences:test_support",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/ukm/ios:features",
"//components/unified_consent",
"//ios/chrome/app/strings",
"//ios/chrome/browser",
"//ios/chrome/browser/browser_state",
......@@ -304,7 +296,6 @@ source_set("unit_tests") {
"//ios/chrome/browser/ui/settings/cells",
"//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/table_view:test_support",
"//ios/chrome/browser/ui/util",
"//ios/chrome/browser/voice",
"//ios/chrome/browser/web",
"//ios/chrome/browser/web:test_support",
......@@ -351,8 +342,6 @@ source_set("eg_tests") {
"//components/prefs",
"//components/search_engines",
"//components/strings",
"//components/ukm/ios:features",
"//components/unified_consent",
"//ios/chrome/app:app_internal",
"//ios/chrome/app/strings",
"//ios/chrome/app/theme",
......@@ -370,8 +359,6 @@ source_set("eg_tests") {
"//ios/chrome/browser/ui/authentication/cells",
"//ios/chrome/browser/ui/settings:test_support",
"//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:test_support",
"//ios/chrome/test/app:test_support",
......
......@@ -14,8 +14,6 @@
#include "components/strings/grit/components_strings.h"
#include "components/sync_preferences/pref_service_mock_factory.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/browser_state/test_chrome_browser_state.h"
#include "ios/chrome/browser/pref_names.h"
......@@ -95,9 +93,7 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) {
EXPECT_EQ(2, NumberOfSections());
// Sections[0].
const int kExpectedNumberOfItermsInSection0 =
unified_consent::IsUnifiedConsentFeatureEnabled() ? 2 : 4;
EXPECT_EQ(kExpectedNumberOfItermsInSection0, NumberOfItemsInSection(0));
EXPECT_EQ(2, NumberOfItemsInSection(0));
NSString* handoffSubtitle = chrome_browser_state_->GetPrefs()->GetBoolean(
prefs::kIosHandoffToOtherDevices)
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
......@@ -109,19 +105,6 @@ TEST_F(PrivacyTableViewControllerTest, TestModel) {
NO, l10n_util::GetNSString(IDS_SETTINGS_CAN_MAKE_PAYMENT_TOGGLE_LABEL), 0,
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].
EXPECT_EQ(1, NumberOfItemsInSection(1));
CheckTextCellText(l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_TITLE),
......
......@@ -19,7 +19,6 @@
#include "components/prefs/pref_member.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/unified_consent/feature.h"
#import "ios/chrome/app/main_controller.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h"
......@@ -75,10 +74,6 @@ enum MetricsServiceType {
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.
id<GREYMatcher> ClearBrowsingDataCell() {
return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BROWSING_DATA_TITLE);
......@@ -721,20 +716,11 @@ id<GREYMatcher> BandwidthSettingsButton() {
GREYAssertNil(settings.keyCommands,
@"Settings should not register key commands when presented.");
// Dismiss the Sign-in UI.
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
// Cancel the sign-in operation.
[[EarlGrey selectElementWithMatcher:
grey_buttonTitle([l10n_util::GetNSString(
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()];
}
// Cancel the sign-in operation.
[[EarlGrey selectElementWithMatcher:
grey_buttonTitle([l10n_util::GetNSString(
IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON)
uppercaseString])] performAction:grey_tap()];
// Wait for UI to finish closing the Sign-in screen.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
......@@ -744,20 +730,4 @@ id<GREYMatcher> BandwidthSettingsButton() {
@"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
......@@ -22,7 +22,6 @@
#import "components/signin/public/identity_manager/objc/identity_manager_observer_bridge.h"
#include "components/strings/grit/components_strings.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/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
......@@ -383,15 +382,13 @@ NSString* kDevViewSourceKey = @"DevViewSource";
[model addItem:[self accountCellItem]
toSectionWithIdentifier:SectionIdentifierAccount];
}
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
if (![model hasSectionForSectionIdentifier:SectionIdentifierAccount]) {
// Add the Account section for the Google services cell, if the user is
// signed-out.
[model addSectionWithIdentifier:SectionIdentifierAccount];
}
[model addItem:[self googleServicesCellItem]
toSectionWithIdentifier:SectionIdentifierAccount];
if (![model hasSectionForSectionIdentifier:SectionIdentifierAccount]) {
// Add the Account section for the Google services cell, if the user is
// signed-out.
[model addSectionWithIdentifier:SectionIdentifierAccount];
}
[model addItem:[self googleServicesCellItem]
toSectionWithIdentifier:SectionIdentifierAccount];
// Basics section
[model addSectionWithIdentifier:SectionIdentifierBasics];
......@@ -454,13 +451,8 @@ NSString* kDevViewSourceKey = @"DevViewSource";
if (_signinPromoViewMediator) {
TableViewSigninPromoItem* signinPromoItem =
[[TableViewSigninPromoItem alloc] initWithType:ItemTypeSigninPromo];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
signinPromoItem.text =
l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS_WITH_UNITY);
} else {
signinPromoItem.text =
l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS);
}
signinPromoItem.text =
l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_SETTINGS_WITH_UNITY);
signinPromoItem.configurator =
[_signinPromoViewMediator createConfigurator];
signinPromoItem.delegate = _signinPromoViewMediator;
......@@ -969,33 +961,7 @@ NSString* kDevViewSourceKey = @"DevViewSource";
}
identityAccountItem.image = [self userAccountImage];
identityAccountItem.text = [_identity userFullName];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
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);
}
identityAccountItem.detailText = _identity.userEmail;
}
- (void)reloadAccountCell {
......@@ -1138,11 +1104,7 @@ NSString* kDevViewSourceKey = @"DevViewSource";
#pragma mark SyncObserverModelBridge
- (void)onSyncStateChanged {
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
[self reloadGoogleServicesCell];
} else {
[self reloadAccountCell];
}
[self reloadGoogleServicesCell];
}
#pragma mark - IdentityRefreshLogic
......
......@@ -6,7 +6,6 @@
#include "base/strings/sys_string_conversions.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/pref_names.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
......@@ -43,19 +42,11 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState];
[ChromeEarlGreyUI tapSettingsMenuButton:PrimarySignInButton()];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
// Cancel the sign-in operation.
[[EarlGrey selectElementWithMatcher:
grey_buttonTitle([l10n_util::GetNSString(
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()];
}
// Cancel the sign-in operation.
[[EarlGrey selectElementWithMatcher:
grey_buttonTitle([l10n_util::GetNSString(
IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON)
uppercaseString])] performAction:grey_tap()];
[SigninEarlGreyUI
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