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.
<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
</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]">
Sends searches from the address bar and search box, and some cookies to your default search engine
</message>
......
......@@ -51,7 +51,6 @@ source_set("sync") {
"//components/sync",
"//components/sync_preferences",
"//components/sync_sessions",
"//components/unified_consent",
"//components/version_info",
"//google_apis",
"//ios/chrome/browser",
......
......@@ -17,7 +17,6 @@
#include "components/signin/core/browser/device_id_helper.h"
#include "components/sync/driver/startup_controller.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/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
......
......@@ -11,16 +11,15 @@
#include "components/sync/base/stop_source.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
#include "components/unified_consent/feature.h"
#include "google_apis/gaia/google_service_auth_error.h"
namespace {
// The set of user-selectable datatypes. This must be in the same order as
// |SyncSetupService::SyncableDatatype|.
syncer::ModelType kDataTypes[] = {
syncer::BOOKMARKS, syncer::TYPED_URLS, syncer::PASSWORDS,
syncer::PROXY_TABS, syncer::AUTOFILL, syncer::PREFERENCES,
syncer::READING_LIST, syncer::USER_EVENTS,
syncer::BOOKMARKS, syncer::TYPED_URLS, syncer::PASSWORDS,
syncer::PROXY_TABS, syncer::AUTOFILL, syncer::PREFERENCES,
syncer::READING_LIST,
};
} // namespace
......@@ -28,9 +27,6 @@ SyncSetupService::SyncSetupService(syncer::SyncService* sync_service)
: sync_service_(sync_service) {
DCHECK(sync_service_);
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]);
}
}
......
......@@ -40,7 +40,6 @@ class SyncSetupService : public KeyedService {
kSyncAutofill,
kSyncPreferences,
kSyncReadingList,
kSyncUserEvent,
kNumberOfSyncableDatatypes
};
......
......@@ -136,36 +136,6 @@ using chrome_test_util::SettingsDoneButton;
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
// Opens the Google services settings.
......@@ -297,11 +267,6 @@ using chrome_test_util::SettingsDoneButton;
[self
assertCellWithTitleID:IDS_IOS_GOOGLE_SERVICES_SETTINGS_READING_LIST_TEXT
detailTextID:0];
[self
assertCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_TEXT
detailTextID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL];
[self
assertCellWithTitleID:
IDS_IOS_GOOGLE_SERVICES_SETTINGS_GOOGLE_ACTIVITY_CONTROL_TEXT
......
......@@ -72,7 +72,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
SyncSettingsItemType,
SyncReadingListItemType,
AutocompleteWalletItemType,
SyncActivityAndInteractionsItemType,
SyncGoogleActivityControlsItemType,
EncryptionItemType,
ManageSyncedDataItemType,
......@@ -143,9 +142,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
@property(nonatomic, strong, readonly) ItemArray personalizedItems;
// Item for the autocomplete wallet feature.
@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.
@property(nonatomic, strong, readonly)
SettingsCollapsibleItem* nonPersonalizedServicesItem;
......@@ -177,7 +173,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
@synthesize syncPersonalizationItem = _syncPersonalizationItem;
@synthesize personalizedItems = _personalizedItems;
@synthesize autocompleteWalletItem = _autocompleteWalletItem;
@synthesize syncActivityAndInteractionsItem = _syncActivityAndInteractionsItem;
@synthesize nonPersonalizedServicesItem = _nonPersonalizedServicesItem;
@synthesize nonPersonalizedItems = _nonPersonalizedItems;
......@@ -403,8 +398,8 @@ initWithUserPrefService:(PrefService*)userPrefService
_personalizedItems = @[
syncBookmarksItem, syncHistoryItem, syncPasswordsItem, syncOpenTabsItem,
syncAutofillItem, syncSettingsItem, syncReadingListItem,
self.autocompleteWalletItem, self.syncActivityAndInteractionsItem,
syncGoogleActivityControlsItem, encryptionItem, manageSyncedDataItem
self.autocompleteWalletItem, syncGoogleActivityControlsItem,
encryptionItem, manageSyncedDataItem
];
}
return _personalizedItems;
......@@ -424,20 +419,6 @@ initWithUserPrefService:(PrefService*)userPrefService
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 {
if (!_nonPersonalizedServicesItem) {
_nonPersonalizedServicesItem = [self
......@@ -622,14 +603,6 @@ textItemWithItemType:(NSInteger)itemType
// Autocomplete wallet item should be disabled when autofill is off.
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.
......@@ -764,8 +737,7 @@ textItemWithItemType:(NSInteger)itemType
// TODO(crbug.com/899791): Should reloads only the updated items (instead of
// reload the full section), and get ride of
// |self.personalizedSectionBeingAnimated|. This will get a smoother animation
// for "Autocomplete wall" switch and "Sync Activity and Interactions" switch
// when being tapped by the user.
// for "Autocomplete wall" switch switch when being tapped by the user.
if (!self.personalizedSectionBeingAnimated) {
CollectionViewModel* model = self.consumer.collectionViewModel;
NSMutableIndexSet* sectionIndexToReload = [NSMutableIndexSet indexSet];
......@@ -776,9 +748,6 @@ textItemWithItemType:(NSInteger)itemType
// |self.autocompleteWalletItem| needs to be reloaded in case the autofill
// data type changed state.
[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];
}
......
......@@ -332,10 +332,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; ++i) {
SyncSetupService::SyncableDatatype dataType =
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]
toSectionWithIdentifier:SectionIdentifierSyncServices];
}
......@@ -838,10 +834,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
index < SyncSetupService::kNumberOfSyncableDatatypes; ++index) {
SyncSetupService::SyncableDatatype dataType =
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
indexPathForItemType:ItemTypeSyncableDataType
sectionIdentifier:SectionIdentifierSyncServices
......@@ -977,8 +969,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
return IDS_SYNC_DATATYPE_PREFERENCES;
case SyncSetupService::kSyncReadingList:
return IDS_SYNC_DATATYPE_READING_LIST;
case SyncSetupService::kSyncUserEvent:
// Not supported for the code before the unified consent.
case SyncSetupService::kNumberOfSyncableDatatypes:
NOTREACHED();
}
......
......@@ -241,11 +241,10 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) {
EXPECT_EQ(3, NumberOfSections());
EXPECT_EQ(1, NumberOfItemsInSection(0));
// There is one item per data type, except for unified consent that is
// unsupported by the old UI. In addition, there are two extra items, one
// for "Sync Everything" and another for Autofill wallet import.
// There are two extra items, one for "Sync Everything" and another for
// Autofill wallet import.
constexpr int expected_number_of_items =
SyncSetupService::kNumberOfSyncableDatatypes - 1 + 2;
SyncSetupService::kNumberOfSyncableDatatypes + 2;
EXPECT_EQ(expected_number_of_items, NumberOfItemsInSection(1));
EXPECT_EQ(2, NumberOfItemsInSection(2));
......@@ -266,10 +265,6 @@ TEST_F(SyncSettingsCollectionViewControllerTest, TestModel) {
for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; i++) {
SyncSetupService::SyncableDatatype dataType =
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++);
EXPECT_NSEQ(syncDataTypeItem.text,
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