Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java

Issue 1101373002: [Sync] Fix passphrase prompt for legacy accounts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lint Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java
index 3277df88d8228026a766ac6e5c7473207ea435a1..284b3ec370d35ba1fa0b471979d508c358c2d98a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java
@@ -76,63 +76,56 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL
LayoutInflater inflater = getActivity().getLayoutInflater();
View v = inflater.inflate(R.layout.sync_enter_passphrase, null);
- boolean isGaia = getArguments().getBoolean(ARG_IS_GAIA);
TextView promptText = (TextView) v.findViewById(R.id.prompt_text);
final EditText passphrase = (EditText) v.findViewById(R.id.passphrase);
final Context context = passphrase.getContext();
TextView resetText = (TextView) v.findViewById(R.id.reset_text);
ProfileSyncService profileSyncService = ProfileSyncService.get(context);
String accountName = profileSyncService.getCurrentSignedInAccountText() + "\n\n";
- if (isGaia) {
- promptText.setText(accountName + context.getText(
- R.string.sync_enter_google_passphrase));
- passphrase.setHint(R.string.sync_enter_google_passphrase_hint);
- } else {
- if (profileSyncService.hasExplicitPassphraseTime()) {
- resetText.setText(SpanApplier.applySpans(
- context.getString(R.string.sync_passphrase_reset_instructions),
- new SpanInfo("<link>", "</link>", new ClickableSpan() {
- @Override
- public void onClick(View view) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(
- context.getText(R.string.sync_dashboard_url).toString()));
- intent.putExtra(Browser.EXTRA_APPLICATION_ID,
- context.getPackageName());
- intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true);
- intent.setPackage(context.getPackageName());
- context.startActivity(intent);
- Activity activity = getActivity();
- if (activity != null) activity.finish();
- }
- })));
- resetText.setMovementMethod(LinkMovementMethod.getInstance());
- resetText.setVisibility(View.VISIBLE);
- PassphraseType passphraseType = profileSyncService.getPassphraseType();
- switch (passphraseType) {
- case FROZEN_IMPLICIT_PASSPHRASE:
- promptText.setText(accountName + profileSyncService
- .getSyncEnterGooglePassphraseBodyWithDateText());
- break;
- case CUSTOM_PASSPHRASE:
- promptText.setText(accountName + profileSyncService
- .getSyncEnterCustomPassphraseBodyWithDateText());
- break;
- case IMPLICIT_PASSPHRASE: // Falling through intentionally.
- case KEYSTORE_PASSPHRASE: // Falling through intentionally.
- default:
- Log.w(TAG, "Found incorrect passphrase type "
- + passphraseType
- + ". Falling back to default string.");
- promptText.setText(accountName
- + profileSyncService.getSyncEnterCustomPassphraseBodyText());
- break;
- }
- } else {
- promptText.setText(accountName
- + profileSyncService.getSyncEnterCustomPassphraseBodyText());
+ resetText.setText(SpanApplier.applySpans(
+ context.getString(R.string.sync_passphrase_reset_instructions),
+ new SpanInfo("<link>", "</link>", new ClickableSpan() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(
+ context.getText(R.string.sync_dashboard_url).toString()));
+ intent.putExtra(Browser.EXTRA_APPLICATION_ID,
+ context.getPackageName());
+ intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true);
+ intent.setPackage(context.getPackageName());
+ context.startActivity(intent);
+ Activity activity = getActivity();
+ if (activity != null) activity.finish();
+ }
+ })));
+ resetText.setMovementMethod(LinkMovementMethod.getInstance());
+ resetText.setVisibility(View.VISIBLE);
+ PassphraseType passphraseType = profileSyncService.getPassphraseType();
+ if (profileSyncService.hasExplicitPassphraseTime()) {
+ switch (passphraseType) {
+ case FROZEN_IMPLICIT_PASSPHRASE:
+ promptText.setText(accountName + profileSyncService
+ .getSyncEnterGooglePassphraseBodyWithDateText());
+ break;
+ case CUSTOM_PASSPHRASE:
+ promptText.setText(accountName + profileSyncService
+ .getSyncEnterCustomPassphraseBodyWithDateText());
+ break;
+ case IMPLICIT_PASSPHRASE: // Falling through intentionally.
+ case KEYSTORE_PASSPHRASE: // Falling through intentionally.
+ default:
+ Log.w(TAG, "Found incorrect passphrase type "
+ + passphraseType
+ + ". Falling back to default string.");
+ promptText.setText(accountName
+ + profileSyncService.getSyncEnterCustomPassphraseBodyText());
+ break;
}
- passphrase.setHint(R.string.sync_enter_custom_passphrase_hint);
+ } else {
+ promptText.setText(accountName
maxbogue 2015/04/28 00:40:26 Are we assuming here that the type is CUSTOM_PASSP
+ + profileSyncService.getSyncEnterCustomPassphraseBodyText());
}
+ passphrase.setHint(R.string.sync_enter_custom_passphrase_hint);
maxbogue 2015/04/28 00:40:26 This will set the hint for the field to "Passphras
passphrase.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

Powered by Google App Engine
This is Rietveld 408576698