Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java |
| index eefa711f4f69260dae9483cad85a7bf988cc3300..769b020c7ecae3d1e84a5dd61a2d165e7d5b7d08 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java |
| @@ -112,7 +112,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| public static final String ARGUMENT_ACCOUNT = "account"; |
| private ChromeSwitchPreference mSyncSwitchPreference; |
| - private boolean mIsBackendInitialized; |
| + private boolean mIsEngineInitialized; |
| private boolean mIsPassphraseRequired; |
| @VisibleForTesting |
| @@ -152,9 +152,9 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
| mProfileSyncService = ProfileSyncService.get(); |
| assert mProfileSyncService != null; |
| - mIsBackendInitialized = mProfileSyncService.isBackendInitialized(); |
| + mIsEngineInitialized = mProfileSyncService.isEngineInitialized(); |
| mIsPassphraseRequired = |
| - mIsBackendInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| + mIsEngineInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| getActivity().setTitle(R.string.sign_in_sync); |
| @@ -281,9 +281,9 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| // account preference displays the correct signed in account. |
| mSyncedAccountPreference.update(); |
| - mIsBackendInitialized = mProfileSyncService.isBackendInitialized(); |
| + mIsEngineInitialized = mProfileSyncService.isEngineInitialized(); |
| mIsPassphraseRequired = |
| - mIsBackendInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| + mIsEngineInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| // This prevents sync from actually syncing until the dialog is closed. |
| mProfileSyncService.setSetupInProgress(true); |
| mProfileSyncService.addSyncStateChangedListener(this); |
| @@ -366,10 +366,10 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| */ |
| private void updateEncryptionState() { |
| boolean isSyncEnabled = mSyncSwitchPreference.isChecked(); |
| - boolean isBackendInitialized = mProfileSyncService.isBackendInitialized(); |
| - mSyncEncryption.setEnabled(isSyncEnabled && isBackendInitialized); |
| + boolean isEngineInitialized = mProfileSyncService.isEngineInitialized(); |
| + mSyncEncryption.setEnabled(isSyncEnabled && isEngineInitialized); |
| mSyncEncryption.setSummary(null); |
| - if (!isBackendInitialized) { |
| + if (!isEngineInitialized) { |
| // If sync is not initialized, encryption state is unavailable and can't be changed. |
| // Leave the button disabled and the summary empty. Additionally, close the dialogs in |
| // case they were open when a stop and clear comes. |
| @@ -454,7 +454,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| } |
| private void configureEncryption(String passphrase) { |
| - if (mProfileSyncService.isBackendInitialized()) { |
| + if (mProfileSyncService.isEngineInitialized()) { |
| mProfileSyncService.enableEncryptEverything(); |
| mProfileSyncService.setEncryptionPassphrase(passphrase); |
| // Configure the current set of data types - this tells the sync engine to |
| @@ -486,7 +486,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| */ |
| @Override |
| public boolean onPassphraseEntered(String passphrase) { |
| - if (!mProfileSyncService.isBackendInitialized()) { |
| + if (!mProfileSyncService.isEngineInitialized()) { |
| // If the backend was shut down since the dialog was opened, do nothing. |
|
skym
2016/12/05 19:38:55
backend
maxbogue
2016/12/05 22:17:10
Done.
|
| return false; |
| } |
| @@ -505,7 +505,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| */ |
| @Override |
| public void onPassphraseCreated(String passphrase) { |
| - if (!mProfileSyncService.isBackendInitialized()) { |
| + if (!mProfileSyncService.isEngineInitialized()) { |
| // If the backend was shut down since the dialog was opened, do nothing. |
|
skym
2016/12/05 19:38:55
backend
maxbogue
2016/12/05 22:17:10
Done.
|
| return; |
| } |
| @@ -517,7 +517,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| */ |
| @Override |
| public void onPassphraseTypeSelected(PassphraseType type) { |
| - if (!mProfileSyncService.isBackendInitialized()) { |
| + if (!mProfileSyncService.isEngineInitialized()) { |
| // If the backend was shut down since the dialog was opened, do nothing. |
|
skym
2016/12/05 19:38:55
backend
maxbogue
2016/12/05 22:17:10
Done.
|
| return; |
| } |
| @@ -542,7 +542,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| // roughly the same time. See http://b/5983282 |
| return false; |
| } |
| - if (preference == mSyncEncryption && mProfileSyncService.isBackendInitialized()) { |
| + if (preference == mSyncEncryption && mProfileSyncService.isEngineInitialized()) { |
| if (mProfileSyncService.isPassphraseRequiredForDecryption()) { |
| displayPassphraseDialog(); |
| } else { |
| @@ -592,7 +592,7 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| private void updateDataTypeState() { |
| boolean isSyncEnabled = mSyncSwitchPreference.isChecked(); |
| boolean syncEverything = mSyncEverything.isChecked(); |
| - boolean passwordSyncConfigurable = mProfileSyncService.isBackendInitialized() |
| + boolean passwordSyncConfigurable = mProfileSyncService.isEngineInitialized() |
| && mProfileSyncService.isCryptographerReady(); |
| Set<Integer> syncTypes = mProfileSyncService.getPreferredDataTypes(); |
| boolean syncAutofill = syncTypes.contains(ModelType.AUTOFILL); |
| @@ -753,12 +753,12 @@ public class SyncCustomizationFragment extends PreferenceFragment |
| */ |
| @Override |
| public void syncStateChanged() { |
| - boolean wasSyncInitialized = mIsBackendInitialized; |
| + boolean wasSyncInitialized = mIsEngineInitialized; |
| boolean wasPassphraseRequired = mIsPassphraseRequired; |
| - mIsBackendInitialized = mProfileSyncService.isBackendInitialized(); |
| + mIsEngineInitialized = mProfileSyncService.isEngineInitialized(); |
| mIsPassphraseRequired = |
| - mIsBackendInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| - if (mIsBackendInitialized != wasSyncInitialized |
| + mIsEngineInitialized && mProfileSyncService.isPassphraseRequiredForDecryption(); |
| + if (mIsEngineInitialized != wasSyncInitialized |
| || mIsPassphraseRequired != wasPassphraseRequired) { |
| // Update all because Password syncability is also affected by the backend. |
| updateSyncStateFromSwitch(); |