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",
......
...@@ -6,41 +6,26 @@ ...@@ -6,41 +6,26 @@
#include "base/logging.h" #include "base/logging.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "components/google/core/common/google_util.h"
#include "components/handoff/pref_names_ios.h" #include "components/handoff/pref_names_ios.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/payments/core/payment_prefs.h" #include "components/payments/core/payment_prefs.h"
#import "components/prefs/ios/pref_observer_bridge.h" #import "components/prefs/ios/pref_observer_bridge.h"
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.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/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/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/browsing_data/browsing_data_features.h" #include "ios/chrome/browser/browsing_data/browsing_data_features.h"
#include "ios/chrome/browser/chrome_url_constants.h"
#include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_local_commands.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_local_commands.h"
#import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/dataplan_usage_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/handoff_table_view_controller.h" #import "ios/chrome/browser/ui/settings/handoff_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
#import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
#import "ios/chrome/browser/ui/settings/utils/settings_utils.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_header_footer_item.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#include "ios/chrome/browser/ui/util/ui_util.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -63,9 +48,6 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) { ...@@ -63,9 +48,6 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) {
typedef NS_ENUM(NSInteger, ItemType) { typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeOtherDevicesHandoff = kItemTypeEnumZero, ItemTypeOtherDevicesHandoff = kItemTypeEnumZero,
ItemTypeWebServicesPaymentSwitch, ItemTypeWebServicesPaymentSwitch,
ItemTypeWebServicesSendUsageData,
ItemTypeWebServicesShowSuggestions,
ItemTypeWebServicesFooter,
ItemTypeClearBrowsingDataClear, ItemTypeClearBrowsingDataClear,
// Footer to suggest the user to open Sync and Google services settings. // Footer to suggest the user to open Sync and Google services settings.
ItemTypeClearBrowsingDataFooter, ItemTypeClearBrowsingDataFooter,
...@@ -77,13 +59,9 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -77,13 +59,9 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
} // namespace } // namespace
@interface PrivacyTableViewController () <BooleanObserver, @interface PrivacyTableViewController () <ClearBrowsingDataLocalCommands,
ClearBrowsingDataLocalCommands,
PrefObserverDelegate> { PrefObserverDelegate> {
ios::ChromeBrowserState* _browserState; // weak ios::ChromeBrowserState* _browserState; // weak
PrefBackedBoolean* _suggestionsEnabled;
// The item related to the switch for the show suggestions setting.
SettingsSwitchItem* _showSuggestionsItem;
// Pref observer to track changes to prefs. // Pref observer to track changes to prefs.
std::unique_ptr<PrefObserverBridge> _prefObserverBridge; std::unique_ptr<PrefObserverBridge> _prefObserverBridge;
...@@ -93,8 +71,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -93,8 +71,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
// Updatable Items // Updatable Items
TableViewDetailIconItem* _handoffDetailItem; TableViewDetailIconItem* _handoffDetailItem;
TableViewDetailIconItem* _sendUsageDetailItem;
SettingsSwitchItem* _sendUsageToggleSwitchItem;
} }
@end @end
...@@ -114,14 +90,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -114,14 +90,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
_browserState = browserState; _browserState = browserState;
self.title = self.title =
l10n_util::GetNSString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY); l10n_util::GetNSString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY);
if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
// When unified consent flag is enabled, the suggestion setting is
// available in the "Google Services and sync" settings.
_suggestionsEnabled = [[PrefBackedBoolean alloc]
initWithPrefService:_browserState->GetPrefs()
prefName:prefs::kSearchSuggestEnabled];
[_suggestionsEnabled setObserver:self];
}
PrefService* prefService = _browserState->GetPrefs(); PrefService* prefService = _browserState->GetPrefs();
...@@ -133,14 +101,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -133,14 +101,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
// screen. // screen.
_prefObserverBridge->ObserveChangesForPreference( _prefObserverBridge->ObserveChangesForPreference(
prefs::kIosHandoffToOtherDevices, &_prefChangeRegistrar); prefs::kIosHandoffToOtherDevices, &_prefChangeRegistrar);
if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
_prefObserverBridge->ObserveChangesForPreference(
metrics::prefs::kMetricsReportingEnabled,
&_prefChangeRegistrarApplicationContext);
_prefObserverBridge->ObserveChangesForPreference(
prefs::kMetricsReportingWifiOnly,
&_prefChangeRegistrarApplicationContext);
}
} }
return self; return self;
} }
...@@ -167,34 +127,13 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -167,34 +127,13 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
toSectionWithIdentifier:SectionIdentifierWebServices]; toSectionWithIdentifier:SectionIdentifierWebServices];
[model addItem:[self canMakePaymentItem] [model addItem:[self canMakePaymentItem]
toSectionWithIdentifier:SectionIdentifierWebServices]; toSectionWithIdentifier:SectionIdentifierWebServices];
if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
// When unified consent flag is enabled, the show suggestions feature and
// metrics reporting feature are available in the "Google Services and sync"
// settings.
if (base::FeatureList::IsEnabled(kUmaCellular)) {
[model addItem:[self sendUsageToggleSwitchItem]
toSectionWithIdentifier:SectionIdentifierWebServices];
} else {
[model addItem:[self sendUsageDetailItem]
toSectionWithIdentifier:SectionIdentifierWebServices];
}
_showSuggestionsItem = [self showSuggestionsSwitchItem];
[model addItem:_showSuggestionsItem
toSectionWithIdentifier:SectionIdentifierWebServices];
[model setFooter:[self showSuggestionsFooterItem]
forSectionWithIdentifier:SectionIdentifierWebServices];
}
// Clear Browsing Section // Clear Browsing Section
[model addSectionWithIdentifier:SectionIdentifierClearBrowsingData]; [model addSectionWithIdentifier:SectionIdentifierClearBrowsingData];
[model addItem:[self clearBrowsingDetailItem] [model addItem:[self clearBrowsingDetailItem]
toSectionWithIdentifier:SectionIdentifierClearBrowsingData]; toSectionWithIdentifier:SectionIdentifierClearBrowsingData];
if (unified_consent::IsUnifiedConsentFeatureEnabled()) { [model setFooter:[self showClearBrowsingDataFooterItem]
[model setFooter:[self showClearBrowsingDataFooterItem] forSectionWithIdentifier:SectionIdentifierClearBrowsingData];
forSectionWithIdentifier:SectionIdentifierClearBrowsingData];
}
} }
#pragma mark - Model Objects #pragma mark - Model Objects
...@@ -212,29 +151,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -212,29 +151,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
return _handoffDetailItem; return _handoffDetailItem;
} }
- (SettingsSwitchItem*)showSuggestionsSwitchItem {
SettingsSwitchItem* showSuggestionsSwitchItem = [[SettingsSwitchItem alloc]
initWithType:ItemTypeWebServicesShowSuggestions];
showSuggestionsSwitchItem.text =
l10n_util::GetNSString(IDS_IOS_OPTIONS_SEARCH_URL_SUGGESTIONS);
showSuggestionsSwitchItem.on = [_suggestionsEnabled value];
return showSuggestionsSwitchItem;
}
- (TableViewHeaderFooterItem*)showSuggestionsFooterItem {
TableViewLinkHeaderFooterItem* showSuggestionsFooterItem =
[[TableViewLinkHeaderFooterItem alloc]
initWithType:ItemTypeWebServicesFooter];
showSuggestionsFooterItem.text =
l10n_util::GetNSString(IDS_IOS_OPTIONS_PRIVACY_FOOTER);
showSuggestionsFooterItem.linkURL = google_util::AppendGoogleLocaleParam(
GURL(kPrivacyLearnMoreURL),
GetApplicationContext()->GetApplicationLocale());
return showSuggestionsFooterItem;
}
// Creates TableViewHeaderFooterItem instance to show a link to open the Sync // Creates TableViewHeaderFooterItem instance to show a link to open the Sync
// and Google services settings. // and Google services settings.
- (TableViewHeaderFooterItem*)showClearBrowsingDataFooterItem { - (TableViewHeaderFooterItem*)showClearBrowsingDataFooterItem {
...@@ -273,31 +189,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -273,31 +189,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
isEnabled); isEnabled);
} }
- (TableViewItem*)sendUsageDetailItem {
NSString* detailText = [DataplanUsageTableViewController
currentLabelForPreference:GetApplicationContext()->GetLocalState()
basePref:metrics::prefs::kMetricsReportingEnabled
wifiPref:prefs::kMetricsReportingWifiOnly];
_sendUsageDetailItem =
[self detailItemWithType:ItemTypeWebServicesSendUsageData
titleId:IDS_IOS_OPTIONS_SEND_USAGE_DATA
detailText:detailText];
return _sendUsageDetailItem;
}
- (SettingsSwitchItem*)sendUsageToggleSwitchItem {
_sendUsageToggleSwitchItem = [[SettingsSwitchItem alloc]
initWithType:ItemTypeWebServicesSendUsageData];
_sendUsageToggleSwitchItem.text =
l10n_util::GetNSString(IDS_IOS_OPTIONS_SEND_USAGE_DATA);
_sendUsageToggleSwitchItem.on =
GetApplicationContext()->GetLocalState()->GetBoolean(
metrics::prefs::kMetricsReportingEnabled);
return _sendUsageToggleSwitchItem;
}
- (TableViewDetailIconItem*)detailItemWithType:(NSInteger)type - (TableViewDetailIconItem*)detailItemWithType:(NSInteger)type
titleId:(NSInteger)titleId titleId:(NSInteger)titleId
detailText:(NSString*)detailText { detailText:(NSString*)detailText {
...@@ -320,25 +211,12 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -320,25 +211,12 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath]; NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
if (itemType == ItemTypeWebServicesShowSuggestions) { if (itemType == ItemTypeWebServicesPaymentSwitch) {
SettingsSwitchCell* switchCell =
base::mac::ObjCCastStrict<SettingsSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(showSuggestionsToggled:)
forControlEvents:UIControlEventValueChanged];
} else if (itemType == ItemTypeWebServicesPaymentSwitch) {
SettingsSwitchCell* switchCell = SettingsSwitchCell* switchCell =
base::mac::ObjCCastStrict<SettingsSwitchCell>(cell); base::mac::ObjCCastStrict<SettingsSwitchCell>(cell);
[switchCell.switchView addTarget:self [switchCell.switchView addTarget:self
action:@selector(canMakePaymentSwitchChanged:) action:@selector(canMakePaymentSwitchChanged:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
} else if (itemType == ItemTypeWebServicesSendUsageData &&
base::FeatureList::IsEnabled(kUmaCellular)) {
SettingsSwitchCell* switchCell =
base::mac::ObjCCastStrict<SettingsSwitchCell>(cell);
[switchCell.switchView addTarget:self
action:@selector(sendUsageDataToggled:)
forControlEvents:UIControlEventValueChanged];
} }
return cell; return cell;
} }
...@@ -370,16 +248,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -370,16 +248,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
controller = [[HandoffTableViewController alloc] controller = [[HandoffTableViewController alloc]
initWithBrowserState:_browserState]; initWithBrowserState:_browserState];
break; break;
case ItemTypeWebServicesSendUsageData:
if (!base::FeatureList::IsEnabled(kUmaCellular)) {
controller = [[DataplanUsageTableViewController alloc]
initWithPrefs:GetApplicationContext()->GetLocalState()
basePref:metrics::prefs::kMetricsReportingEnabled
wifiPref:prefs::kMetricsReportingWifiOnly
title:l10n_util::GetNSString(
IDS_IOS_OPTIONS_SEND_USAGE_DATA)];
}
break;
case ItemTypeClearBrowsingDataClear: case ItemTypeClearBrowsingDataClear:
if (IsNewClearBrowsingDataUIEnabled()) { if (IsNewClearBrowsingDataUIEnabled()) {
ClearBrowsingDataTableViewController* clearBrowsingDataViewController = ClearBrowsingDataTableViewController* clearBrowsingDataViewController =
...@@ -393,7 +261,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -393,7 +261,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
} }
break; break;
case ItemTypeWebServicesPaymentSwitch: case ItemTypeWebServicesPaymentSwitch:
case ItemTypeWebServicesShowSuggestions:
default: default:
break; break;
} }
...@@ -406,18 +273,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -406,18 +273,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
} }
#pragma mark - BooleanObserver
- (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean {
DCHECK_EQ(observableBoolean, _suggestionsEnabled);
// Update the item.
_showSuggestionsItem.on = [_suggestionsEnabled value];
// Update the cell.
[self reconfigureCellsForItems:@[ _showSuggestionsItem ]];
}
#pragma mark - ClearBrowsingDataLocalCommands #pragma mark - ClearBrowsingDataLocalCommands
- (void)openURL:(const GURL&)URL { - (void)openURL:(const GURL&)URL {
...@@ -435,24 +290,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -435,24 +290,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
#pragma mark - Actions #pragma mark - Actions
- (void)showSuggestionsToggled:(UISwitch*)sender {
NSIndexPath* switchPath = [self.tableViewModel
indexPathForItemType:ItemTypeWebServicesShowSuggestions
sectionIdentifier:SectionIdentifierWebServices];
SettingsSwitchItem* switchItem =
base::mac::ObjCCastStrict<SettingsSwitchItem>(
[self.tableViewModel itemAtIndexPath:switchPath]);
SettingsSwitchCell* switchCell =
base::mac::ObjCCastStrict<SettingsSwitchCell>(
[self.tableView cellForRowAtIndexPath:switchPath]);
DCHECK_EQ(switchCell.switchView, sender);
BOOL isOn = switchCell.switchView.isOn;
switchItem.on = isOn;
[_suggestionsEnabled setValue:isOn];
}
- (void)canMakePaymentSwitchChanged:(UISwitch*)sender { - (void)canMakePaymentSwitchChanged:(UISwitch*)sender {
NSIndexPath* switchPath = NSIndexPath* switchPath =
[self.tableViewModel indexPathForItemType:ItemTypeWebServicesPaymentSwitch [self.tableViewModel indexPathForItemType:ItemTypeWebServicesPaymentSwitch
...@@ -470,20 +307,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -470,20 +307,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
[self setCanMakePaymentEnabled:sender.isOn]; [self setCanMakePaymentEnabled:sender.isOn];
} }
- (void)sendUsageDataToggled:(UISwitch*)sender {
NSIndexPath* switchPath =
[self.tableViewModel indexPathForItem:_sendUsageToggleSwitchItem];
SettingsSwitchCell* switchCell =
base::mac::ObjCCastStrict<SettingsSwitchCell>(
[self.tableView cellForRowAtIndexPath:switchPath]);
DCHECK_EQ(switchCell.switchView, sender);
_sendUsageToggleSwitchItem.on = sender.isOn;
GetApplicationContext()->GetLocalState()->SetBoolean(
metrics::prefs::kMetricsReportingEnabled, sender.isOn);
}
#pragma mark - PrefObserverDelegate #pragma mark - PrefObserverDelegate
- (void)onPreferenceChanged:(const std::string&)preferenceName { - (void)onPreferenceChanged:(const std::string&)preferenceName {
...@@ -496,28 +319,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services"); ...@@ -496,28 +319,6 @@ GURL kGoogleServicesSettingsURL("settings://open_google_services");
[self reconfigureCellsForItems:@[ _handoffDetailItem ]]; [self reconfigureCellsForItems:@[ _handoffDetailItem ]];
return; return;
} }
if (preferenceName == metrics::prefs::kMetricsReportingEnabled ||
preferenceName == prefs::kMetricsReportingWifiOnly) {
DCHECK(!unified_consent::IsUnifiedConsentFeatureEnabled());
if (base::FeatureList::IsEnabled(kUmaCellular)) {
bool isOn = GetApplicationContext()->GetLocalState()->GetBoolean(
metrics::prefs::kMetricsReportingEnabled);
_sendUsageToggleSwitchItem.on = isOn;
[self reconfigureCellsForItems:@[ _sendUsageToggleSwitchItem ]];
return;
} else {
NSString* detailText = [DataplanUsageTableViewController
currentLabelForPreference:GetApplicationContext()->GetLocalState()
basePref:metrics::prefs::kMetricsReportingEnabled
wifiPref:prefs::kMetricsReportingWifiOnly];
_sendUsageDetailItem.detailText = detailText;
[self reconfigureCellsForItems:@[ _sendUsageDetailItem ]];
return;
}
}
} }
#pragma mark - TableViewLinkHeaderFooterItemDelegate #pragma mark - TableViewLinkHeaderFooterItemDelegate
......
...@@ -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