Commit 9f9bb40d authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Removing "Activity and Interactions" settings

Removing "Activity and Interactions" settings. This option is not
available anymore after changes on Unity project.

Bug: 906727,906680
Change-Id: I4401bbf80d8fac257db0e6ee18cc7a6670e71f44
Reviewed-on: https://chromium-review.googlesource.com/c/1343078
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarTatiana Gornak <melandory@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612131}
parent e8d3e6d9
...@@ -705,12 +705,6 @@ locale. The strings in this file are specific to iOS. ...@@ -705,12 +705,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_GOOGLE_APPS_SM_SETTINGS" desc="Title for the view in Settings for managing Google apps specific settings. Translate 'Google Apps'. [Length: 15em] [iOS only]"> <message name="IDS_IOS_GOOGLE_APPS_SM_SETTINGS" desc="Title for the view in Settings for managing Google apps specific settings. Translate 'Google Apps'. [Length: 15em] [iOS only]">
Google Apps Google Apps
</message> </message>
<message name="IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL" desc="Detail text for a feature in the settings for the user to enable/disable, to personalize the user experience. Related to 'Activity and interactions'. [iOS only]">
Uses content on sites you visit and browser activity and interactions for personalization
</message>
<message name="IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT" desc="Title for a feature in the settings for the user to enable/disable, to personalize the user experience. Related to 'Uses content on sites you visit and browser activity and interactions for personalization'. [iOS only]">
Activity and interactions
</message>
<message name="IDS_IOS_GOOGLE_SERVICES_SETTINGS_AUTOCOMPLETE_SEARCHES_AND_URLS_DETAIL" desc="Feature detail text in the settings for the user to enable/disable, to have autocomplete searches and URLs. Text related to 'Autocomplete Searches and URLs' [iOS only]"> <message name="IDS_IOS_GOOGLE_SERVICES_SETTINGS_AUTOCOMPLETE_SEARCHES_AND_URLS_DETAIL" desc="Feature detail text in the settings for the user to enable/disable, to have autocomplete searches and URLs. Text related to 'Autocomplete Searches and URLs' [iOS only]">
Sends searches from the address bar and search box, and some cookies to your default search engine Sends searches from the address bar and search box, and some cookies to your default search engine
</message> </message>
......
...@@ -51,7 +51,6 @@ source_set("sync") { ...@@ -51,7 +51,6 @@ source_set("sync") {
"//components/sync", "//components/sync",
"//components/sync_preferences", "//components/sync_preferences",
"//components/sync_sessions", "//components/sync_sessions",
"//components/unified_consent",
"//components/version_info", "//components/version_info",
"//google_apis", "//google_apis",
"//ios/chrome/browser", "//ios/chrome/browser",
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "components/signin/core/browser/device_id_helper.h" #include "components/signin/core/browser/device_id_helper.h"
#include "components/sync/driver/startup_controller.h" #include "components/sync/driver/startup_controller.h"
#include "components/sync/driver/sync_util.h" #include "components/sync/driver/sync_util.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/autofill/personal_data_manager_factory.h" #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "components/sync/base/stop_source.h" #include "components/sync/base/stop_source.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h" #include "components/sync/driver/sync_user_settings.h"
#include "components/unified_consent/feature.h"
#include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/google_service_auth_error.h"
namespace { namespace {
...@@ -20,7 +19,7 @@ namespace { ...@@ -20,7 +19,7 @@ namespace {
syncer::ModelType kDataTypes[] = { syncer::ModelType kDataTypes[] = {
syncer::BOOKMARKS, syncer::TYPED_URLS, syncer::PASSWORDS, syncer::BOOKMARKS, syncer::TYPED_URLS, syncer::PASSWORDS,
syncer::PROXY_TABS, syncer::AUTOFILL, syncer::PREFERENCES, syncer::PROXY_TABS, syncer::AUTOFILL, syncer::PREFERENCES,
syncer::READING_LIST, syncer::USER_EVENTS, syncer::READING_LIST,
}; };
} // namespace } // namespace
...@@ -28,9 +27,6 @@ SyncSetupService::SyncSetupService(syncer::SyncService* sync_service) ...@@ -28,9 +27,6 @@ SyncSetupService::SyncSetupService(syncer::SyncService* sync_service)
: sync_service_(sync_service) { : sync_service_(sync_service) {
DCHECK(sync_service_); DCHECK(sync_service_);
for (unsigned int i = 0; i < base::size(kDataTypes); ++i) { for (unsigned int i = 0; i < base::size(kDataTypes); ++i) {
if (kDataTypes[i] == syncer::USER_EVENTS &&
!unified_consent::IsUnifiedConsentFeatureEnabled())
continue;
user_selectable_types_.Put(kDataTypes[i]); user_selectable_types_.Put(kDataTypes[i]);
} }
} }
......
...@@ -40,7 +40,6 @@ class SyncSetupService : public KeyedService { ...@@ -40,7 +40,6 @@ class SyncSetupService : public KeyedService {
kSyncAutofill, kSyncAutofill,
kSyncPreferences, kSyncPreferences,
kSyncReadingList, kSyncReadingList,
kSyncUserEvent,
kNumberOfSyncableDatatypes kNumberOfSyncableDatatypes
}; };
......
...@@ -136,36 +136,6 @@ using chrome_test_util::SettingsDoneButton; ...@@ -136,36 +136,6 @@ using chrome_test_util::SettingsDoneButton;
assertWithMatcher:grey_nil()]; assertWithMatcher:grey_nil()];
} }
// Tests that "Activity and Interactions" switch should be disabled when the
// "History" sync is off.
- (void)testActivityAndInteractionsDisabledWithHistoryDisabled {
// TODO(crbug.com/906680): Re-enable this test when it's fixed.
EARL_GREY_TEST_DISABLED(@"Test disabled on devices and simulators.");
[SigninEarlGreyUI signinWithIdentity:[SigninEarlGreyUtils fakeIdentity1]];
[self openGoogleServicesSettings];
// "Activity and Interactions" is enabled.
[self
assertSwitchCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT
detailTextID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL
enabled:YES];
[self scrollUp];
// Turn off "History".
[[self cellElementInteractionWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_HISTORY_TEXT
detailTextID:0] performAction:grey_tap()];
[self scrollUp];
// "Activity and Interactions" is disabled.
[self
assertSwitchCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT
detailTextID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL
enabled:NO];
}
#pragma mark - Helpers #pragma mark - Helpers
// Opens the Google services settings. // Opens the Google services settings.
...@@ -297,11 +267,6 @@ using chrome_test_util::SettingsDoneButton; ...@@ -297,11 +267,6 @@ using chrome_test_util::SettingsDoneButton;
[self [self
assertCellWithTitleID:IDS_IOS_GOOGLE_SERVICES_SETTINGS_READING_LIST_TEXT assertCellWithTitleID:IDS_IOS_GOOGLE_SERVICES_SETTINGS_READING_LIST_TEXT
detailTextID:0]; detailTextID:0];
[self
assertCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT
detailTextID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL];
[self [self
assertCellWithTitleID: assertCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_GOOGLE_ACTIVITY_CONTROL_TEXT IDS_IOS_GOOGLE_SERVICES_SETTINGS_GOOGLE_ACTIVITY_CONTROL_TEXT
......
...@@ -72,7 +72,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -72,7 +72,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
SyncSettingsItemType, SyncSettingsItemType,
SyncReadingListItemType, SyncReadingListItemType,
AutocompleteWalletItemType, AutocompleteWalletItemType,
SyncActivityAndInteractionsItemType,
SyncGoogleActivityControlsItemType, SyncGoogleActivityControlsItemType,
EncryptionItemType, EncryptionItemType,
ManageSyncedDataItemType, ManageSyncedDataItemType,
...@@ -143,9 +142,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -143,9 +142,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
@property(nonatomic, strong, readonly) ItemArray personalizedItems; @property(nonatomic, strong, readonly) ItemArray personalizedItems;
// Item for the autocomplete wallet feature. // Item for the autocomplete wallet feature.
@property(nonatomic, strong, readonly) SyncSwitchItem* autocompleteWalletItem; @property(nonatomic, strong, readonly) SyncSwitchItem* autocompleteWalletItem;
// Item for the activity and interactions feature.
@property(nonatomic, strong, readonly)
SyncSwitchItem* syncActivityAndInteractionsItem;
// Collapsible item for the non-personalized section. // Collapsible item for the non-personalized section.
@property(nonatomic, strong, readonly) @property(nonatomic, strong, readonly)
SettingsCollapsibleItem* nonPersonalizedServicesItem; SettingsCollapsibleItem* nonPersonalizedServicesItem;
...@@ -177,7 +173,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -177,7 +173,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
@synthesize syncPersonalizationItem = _syncPersonalizationItem; @synthesize syncPersonalizationItem = _syncPersonalizationItem;
@synthesize personalizedItems = _personalizedItems; @synthesize personalizedItems = _personalizedItems;
@synthesize autocompleteWalletItem = _autocompleteWalletItem; @synthesize autocompleteWalletItem = _autocompleteWalletItem;
@synthesize syncActivityAndInteractionsItem = _syncActivityAndInteractionsItem;
@synthesize nonPersonalizedServicesItem = _nonPersonalizedServicesItem; @synthesize nonPersonalizedServicesItem = _nonPersonalizedServicesItem;
@synthesize nonPersonalizedItems = _nonPersonalizedItems; @synthesize nonPersonalizedItems = _nonPersonalizedItems;
...@@ -403,8 +398,8 @@ initWithUserPrefService:(PrefService*)userPrefService ...@@ -403,8 +398,8 @@ initWithUserPrefService:(PrefService*)userPrefService
_personalizedItems = @[ _personalizedItems = @[
syncBookmarksItem, syncHistoryItem, syncPasswordsItem, syncOpenTabsItem, syncBookmarksItem, syncHistoryItem, syncPasswordsItem, syncOpenTabsItem,
syncAutofillItem, syncSettingsItem, syncReadingListItem, syncAutofillItem, syncSettingsItem, syncReadingListItem,
self.autocompleteWalletItem, self.syncActivityAndInteractionsItem, self.autocompleteWalletItem, syncGoogleActivityControlsItem,
syncGoogleActivityControlsItem, encryptionItem, manageSyncedDataItem encryptionItem, manageSyncedDataItem
]; ];
} }
return _personalizedItems; return _personalizedItems;
...@@ -424,20 +419,6 @@ initWithUserPrefService:(PrefService*)userPrefService ...@@ -424,20 +419,6 @@ initWithUserPrefService:(PrefService*)userPrefService
return _autocompleteWalletItem; return _autocompleteWalletItem;
} }
- (SyncSwitchItem*)syncActivityAndInteractionsItem {
if (!_syncActivityAndInteractionsItem) {
_syncActivityAndInteractionsItem = [self
switchItemWithItemType:SyncActivityAndInteractionsItemType
textStringID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT
detailStringID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL
commandID:GoogleServicesSettingsCommandIDToggleDataTypeSync
dataType:SyncSetupService::kSyncUserEvent];
}
return _syncActivityAndInteractionsItem;
}
- (SettingsCollapsibleItem*)nonPersonalizedServicesItem { - (SettingsCollapsibleItem*)nonPersonalizedServicesItem {
if (!_nonPersonalizedServicesItem) { if (!_nonPersonalizedServicesItem) {
_nonPersonalizedServicesItem = [self _nonPersonalizedServicesItem = [self
...@@ -622,14 +603,6 @@ textItemWithItemType:(NSInteger)itemType ...@@ -622,14 +603,6 @@ textItemWithItemType:(NSInteger)itemType
// Autocomplete wallet item should be disabled when autofill is off. // Autocomplete wallet item should be disabled when autofill is off.
self.autocompleteWalletItem.on = false; self.autocompleteWalletItem.on = false;
} }
syncer::ModelType historyModelType =
_syncSetupService->GetModelType(SyncSetupService::kSyncOmniboxHistory);
BOOL isHistoryOn = _syncSetupService->IsDataTypePreferred(historyModelType);
self.syncActivityAndInteractionsItem.enabled = enabled && isHistoryOn;
if (!isHistoryOn) {
// Activity and interactions item should be disabled when history is off.
self.syncActivityAndInteractionsItem.on = false;
}
} }
// Updates the non-personalized section according to the user consent. // Updates the non-personalized section according to the user consent.
...@@ -764,8 +737,7 @@ textItemWithItemType:(NSInteger)itemType ...@@ -764,8 +737,7 @@ textItemWithItemType:(NSInteger)itemType
// TODO(crbug.com/899791): Should reloads only the updated items (instead of // TODO(crbug.com/899791): Should reloads only the updated items (instead of
// reload the full section), and get ride of // reload the full section), and get ride of
// |self.personalizedSectionBeingAnimated|. This will get a smoother animation // |self.personalizedSectionBeingAnimated|. This will get a smoother animation
// for "Autocomplete wall" switch and "Sync Activity and Interactions" switch // for "Autocomplete wall" switch switch when being tapped by the user.
// when being tapped by the user.
if (!self.personalizedSectionBeingAnimated) { if (!self.personalizedSectionBeingAnimated) {
CollectionViewModel* model = self.consumer.collectionViewModel; CollectionViewModel* model = self.consumer.collectionViewModel;
NSMutableIndexSet* sectionIndexToReload = [NSMutableIndexSet indexSet]; NSMutableIndexSet* sectionIndexToReload = [NSMutableIndexSet indexSet];
...@@ -776,9 +748,6 @@ textItemWithItemType:(NSInteger)itemType ...@@ -776,9 +748,6 @@ textItemWithItemType:(NSInteger)itemType
// |self.autocompleteWalletItem| needs to be reloaded in case the autofill // |self.autocompleteWalletItem| needs to be reloaded in case the autofill
// data type changed state. // data type changed state.
[self.consumer reloadItem:self.autocompleteWalletItem]; [self.consumer reloadItem:self.autocompleteWalletItem];
// |self.syncActivityAndInteractionsItem| needs to be reloaded in case
// the history data type changed state.
[self.consumer reloadItem:self.syncActivityAndInteractionsItem];
} }
[self updateSyncErrorSectionAndNotifyConsumer:YES]; [self updateSyncErrorSectionAndNotifyConsumer:YES];
} }
......
...@@ -332,10 +332,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -332,10 +332,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; ++i) { for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; ++i) {
SyncSetupService::SyncableDatatype dataType = SyncSetupService::SyncableDatatype dataType =
static_cast<SyncSetupService::SyncableDatatype>(i); static_cast<SyncSetupService::SyncableDatatype>(i);
if (dataType == SyncSetupService::kSyncUserEvent) {
// This data type should only be used with the unified consent UI.
continue;
}
[model addItem:[self switchItemForDataType:dataType] [model addItem:[self switchItemForDataType:dataType]
toSectionWithIdentifier:SectionIdentifierSyncServices]; toSectionWithIdentifier:SectionIdentifierSyncServices];
} }
...@@ -838,10 +834,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -838,10 +834,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
index < SyncSetupService::kNumberOfSyncableDatatypes; ++index) { index < SyncSetupService::kNumberOfSyncableDatatypes; ++index) {
SyncSetupService::SyncableDatatype dataType = SyncSetupService::SyncableDatatype dataType =
static_cast<SyncSetupService::SyncableDatatype>(index); static_cast<SyncSetupService::SyncableDatatype>(index);
if (dataType == SyncSetupService::kSyncUserEvent) {
// This data type should only be used with the unified consent UI.
continue;
}
NSIndexPath* indexPath = [self.collectionViewModel NSIndexPath* indexPath = [self.collectionViewModel
indexPathForItemType:ItemTypeSyncableDataType indexPathForItemType:ItemTypeSyncableDataType
sectionIdentifier:SectionIdentifierSyncServices sectionIdentifier:SectionIdentifierSyncServices
...@@ -977,8 +969,6 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -977,8 +969,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
return IDS_SYNC_DATATYPE_PREFERENCES; return IDS_SYNC_DATATYPE_PREFERENCES;
case SyncSetupService::kSyncReadingList: case SyncSetupService::kSyncReadingList:
return IDS_SYNC_DATATYPE_READING_LIST; return IDS_SYNC_DATATYPE_READING_LIST;
case SyncSetupService::kSyncUserEvent:
// Not supported for the code before the unified consent.
case SyncSetupService::kNumberOfSyncableDatatypes: case SyncSetupService::kNumberOfSyncableDatatypes:
NOTREACHED(); NOTREACHED();
} }
......
...@@ -241,11 +241,10 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) { ...@@ -241,11 +241,10 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) {
EXPECT_EQ(3, NumberOfSections()); EXPECT_EQ(3, NumberOfSections());
EXPECT_EQ(1, NumberOfItemsInSection(0)); EXPECT_EQ(1, NumberOfItemsInSection(0));
// There is one item per data type, except for unified consent that is // There are two extra items, one for "Sync Everything" and another for
// unsupported by the old UI. In addition, there are two extra items, one // Autofill wallet import.
// for "Sync Everything" and another for Autofill wallet import.
constexpr int expected_number_of_items = constexpr int expected_number_of_items =
SyncSetupService::kNumberOfSyncableDatatypes - 1 + 2; SyncSetupService::kNumberOfSyncableDatatypes + 2;
EXPECT_EQ(expected_number_of_items, NumberOfItemsInSection(1)); EXPECT_EQ(expected_number_of_items, NumberOfItemsInSection(1));
EXPECT_EQ(2, NumberOfItemsInSection(2)); EXPECT_EQ(2, NumberOfItemsInSection(2));
...@@ -266,10 +265,6 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) { ...@@ -266,10 +265,6 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) {
for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; i++) { for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; i++) {
SyncSetupService::SyncableDatatype dataType = SyncSetupService::SyncableDatatype dataType =
static_cast<SyncSetupService::SyncableDatatype>(i); static_cast<SyncSetupService::SyncableDatatype>(i);
if (dataType == SyncSetupService::kSyncUserEvent) {
// Old UI without unified consent doesn't support user event data type.
continue;
}
SyncSwitchItem* syncDataTypeItem = GetCollectionViewItem(1, item++); SyncSwitchItem* syncDataTypeItem = GetCollectionViewItem(1, item++);
EXPECT_NSEQ(syncDataTypeItem.text, EXPECT_NSEQ(syncDataTypeItem.text,
l10n_util::GetNSString( l10n_util::GetNSString(
......
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