protected boolean redirectIfAppropriate() {
    final boolean redirected = super.redirectIfAppropriate();
    if (redirected) {
      return true;
    }

    final StringBuilder sb = new StringBuilder();
    sb.append(ABOUT_ACCOUNTS);
    sb.append("?action=");
    sb.append(action);
    sb.append(extras);

    // Pass through a set of known string values from intent extras to about:accounts.
    final Intent intent = getIntent();
    if (intent != null) {
      for (String key : EXTRAS_TO_PASSTHROUGH) {
        final String value = intent.getStringExtra(key);
        if (value != null) {
          sb.append("&");
          sb.append(key);
          sb.append("=");
          sb.append(value);
        }
      }
    }

    ActivityUtils.openURLInFennec(getApplicationContext(), sb.toString());
    return true;
  }
  /** {@inheritDoc} */
  @Override
  public void onCreate(Bundle icicle) {
    Logger.debug(LOG_TAG, "onCreate(" + icicle + ")");

    super.onCreate(icicle);
    setContentView(layoutResourceId);

    emailEdit = (AutoCompleteTextView) ensureFindViewById(null, R.id.email, "email edit");
    passwordEdit = (EditText) ensureFindViewById(null, R.id.password, "password edit");
    showPasswordButton =
        (Button) ensureFindViewById(null, R.id.show_password, "show password button");
    remoteErrorTextView =
        (TextView) ensureFindViewById(null, R.id.remote_error, "remote error text view");
    button = (Button) ensureFindViewById(null, R.id.button, "update credentials");
    progressBar = (ProgressBar) ensureFindViewById(null, R.id.progress, "progress bar");

    minimumPasswordLength = 1; // Minimal restriction on passwords entered to sign in.
    createButton();
    addListeners();
    updateButtonState();
    createShowPasswordButton();

    emailEdit.setEnabled(false);

    TextView view = (TextView) findViewById(R.id.forgot_password_link);
    ActivityUtils.linkTextView(
        view, R.string.fxaccount_sign_in_forgot_password, R.string.fxaccount_link_forgot_password);

    updateFromIntentExtras();
  }
 protected void linkifyOldFirefoxLink() {
   TextView oldFirefox = (TextView) findViewById(R.id.old_firefox);
   String text = getResources().getString(R.string.fxaccount_getting_started_old_firefox);
   final String url = FirefoxAccounts.getOldSyncUpgradeURL(getResources(), Locale.getDefault());
   FxAccountUtils.pii(
       LOG_TAG, "Old Firefox url is: " + url); // Don't want to leak locale in particular.
   ActivityUtils.linkTextView(oldFirefox, text, url);
 }
 protected void linkifyOldFirefoxLink() {
   TextView oldFirefox = (TextView) findViewById(R.id.old_firefox);
   String text = getResources().getString(R.string.fxaccount_getting_started_old_firefox);
   String VERSION = AppConstants.MOZ_APP_VERSION;
   String OS = AppConstants.OS_TARGET;
   // We'll need to adjust this when we have active locale switching.
   String LOCALE = Utils.getLanguageTag(Locale.getDefault());
   String url = getResources().getString(R.string.fxaccount_link_old_firefox, VERSION, OS, LOCALE);
   FxAccountConstants.pii(
       LOG_TAG, "Old Firefox url is: " + url); // Don't want to leak locale in particular.
   ActivityUtils.linkTextView(oldFirefox, text, url);
 }
 protected void linkifyPolicy() {
   TextView policyView = (TextView) ensureFindViewById(null, R.id.policy, "policy links");
   final String linkTerms = getString(R.string.fxaccount_link_tos);
   final String linkPrivacy = getString(R.string.fxaccount_link_pn);
   final String linkedTOS =
       "<a href=\"" + linkTerms + "\">" + getString(R.string.fxaccount_policy_linktos) + "</a>";
   final String linkedPN =
       "<a href=\""
           + linkPrivacy
           + "\">"
           + getString(R.string.fxaccount_policy_linkprivacy)
           + "</a>";
   policyView.setText(
       getString(R.string.fxaccount_create_account_policy_text, linkedTOS, linkedPN));
   final boolean underlineLinks = true;
   ActivityUtils.linkifyTextView(policyView, underlineLinks);
 }