| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller
.h" | 5 #import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller
.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 l10n_util::GetNSString(IDS_IOS_SYNC_DATA_TYPES_TITLE); | 298 l10n_util::GetNSString(IDS_IOS_SYNC_DATA_TYPES_TITLE); |
| 299 [model setHeader:syncServicesHeader | 299 [model setHeader:syncServicesHeader |
| 300 forSectionWithIdentifier:SectionIdentifierSyncServices]; | 300 forSectionWithIdentifier:SectionIdentifierSyncServices]; |
| 301 BOOL syncEverythingEnabled = _syncSetupService->IsSyncingAllDataTypes(); | 301 BOOL syncEverythingEnabled = _syncSetupService->IsSyncingAllDataTypes(); |
| 302 [model addItem:[self syncEverythingSwitchItem:syncEverythingEnabled] | 302 [model addItem:[self syncEverythingSwitchItem:syncEverythingEnabled] |
| 303 toSectionWithIdentifier:SectionIdentifierSyncServices]; | 303 toSectionWithIdentifier:SectionIdentifierSyncServices]; |
| 304 // Specific Data Types to sync. Enabled if Sync Everything is off. | 304 // Specific Data Types to sync. Enabled if Sync Everything is off. |
| 305 for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; ++i) { | 305 for (int i = 0; i < SyncSetupService::kNumberOfSyncableDatatypes; ++i) { |
| 306 SyncSetupService::SyncableDatatype dataType = | 306 SyncSetupService::SyncableDatatype dataType = |
| 307 static_cast<SyncSetupService::SyncableDatatype>(i); | 307 static_cast<SyncSetupService::SyncableDatatype>(i); |
| 308 if (!experimental_flags::IsReadingListEnabled() && | |
| 309 dataType == SyncSetupService::kSyncReadingList) { | |
| 310 // Display Reading List only if it is enabled. | |
| 311 continue; | |
| 312 } | |
| 313 [model addItem:[self switchItemForDataType:dataType] | 308 [model addItem:[self switchItemForDataType:dataType] |
| 314 toSectionWithIdentifier:SectionIdentifierSyncServices]; | 309 toSectionWithIdentifier:SectionIdentifierSyncServices]; |
| 315 } | 310 } |
| 316 | 311 |
| 317 // Encryption section. Enabled if sync is on. | 312 // Encryption section. Enabled if sync is on. |
| 318 [model addSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; | 313 [model addSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; |
| 319 [model addItem:[self encryptionCellItem] | 314 [model addItem:[self encryptionCellItem] |
| 320 toSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; | 315 toSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; |
| 321 [model addItem:[self manageSyncedDataItem] | 316 [model addItem:[self manageSyncedDataItem] |
| 322 toSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; | 317 toSectionWithIdentifier:SectionIdentifierEncryptionAndFooter]; |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 [self updateAccountItem:item withIdentity:identity]; | 982 [self updateAccountItem:item withIdentity:identity]; |
| 988 [self reconfigureCellsForItems:@[ item ] | 983 [self reconfigureCellsForItems:@[ item ] |
| 989 inSectionWithIdentifier:SectionIdentifierSyncAccounts]; | 984 inSectionWithIdentifier:SectionIdentifierSyncAccounts]; |
| 990 } | 985 } |
| 991 | 986 |
| 992 - (void)onChromeIdentityServiceWillBeDestroyed { | 987 - (void)onChromeIdentityServiceWillBeDestroyed { |
| 993 _identityServiceObserver.reset(); | 988 _identityServiceObserver.reset(); |
| 994 } | 989 } |
| 995 | 990 |
| 996 @end | 991 @end |
| OLD | NEW |