~ubuntu-branches/ubuntu/precise/firefox/precise-proposed

« back to all changes in this revision

Viewing changes to toolkit/components/passwordmgr/base/nsPasswordManager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ian Jackson
  • Date: 2005-12-02 20:16:18 UTC
  • Revision ID: james.westby@ubuntu.com-20051202201618-txu8o1sikp5e3by5
Tags: 1.4.99+1.5rc3.dfsg-1ubuntu4
* Applied mozilla-1.7.12-2.src.rpm's firefox-1.0-uriloader.patch
  which causes firefox to look first in the Gnome MIME handling registry
  (MIME handling is still very wrong).
* Disabled File / Import from main menu since it does not work at all
  (Ubuntu bugzilla 10339 still applies; patch brought forward).
* Displayed printer names no longer show `CUPS/' prefix.
  (Ubuntu bugzilla 11481 regressed; patch from Breezy enhanced).
* Print command fixed (again) to cope with spaces in printer names.
* Remove incorrect note about Pango from README.Debian.
* Re-fix-up localised startup URLs in en-US region.properties.
* Fix incorrect layout/sizing in Help / About box (a bit hacky).
* Re-forward-port patch to fix printer names with spaces.
* Remove all subdirectories '*.OBJ' during clean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
835
835
    for (SignonDataEntry* e = hashEnt->head; e; e = e->next) {
836
836
      
837
837
      nsCOMPtr<nsISupports> foundNode;
838
 
      form->ResolveName(e->userField, getter_AddRefs(foundNode));
839
 
      temp = do_QueryInterface(foundNode);
 
838
      if (!(e->userField).IsEmpty()) {
 
839
        form->ResolveName(e->userField, getter_AddRefs(foundNode));
 
840
        temp = do_QueryInterface(foundNode);
 
841
      }
840
842
 
841
843
      nsAutoString oldUserValue;
842
844
 
847
849
 
848
850
        temp->GetValue(oldUserValue);
849
851
        userField = temp;
850
 
      } else {
851
 
        continue;
852
852
      }
853
853
 
854
854
      if (!(e->passField).IsEmpty()) {
855
855
        form->ResolveName(e->passField, getter_AddRefs(foundNode));
856
856
        temp = do_QueryInterface(foundNode);
857
857
      }
858
 
      else {
859
 
        // No password field name was supplied, try to locate one in the form.
 
858
      else if (userField) {
 
859
        // No password field name was supplied, try to locate one in the form,
 
860
        // but only if we have a username field.
860
861
        nsCOMPtr<nsIFormControl> fc(do_QueryInterface(foundNode));
861
862
        PRInt32 index = -1;
862
863
        form->IndexOfControl(fc, &index);
925
926
        }
926
927
      }
927
928
 
928
 
      if (firstMatch && !attachedToInput) {
 
929
      if (firstMatch && userField && !attachedToInput) {
929
930
        // We've found more than one possible signon for this form.
930
931
 
931
932
        // Listen for blur and autocomplete events on the username field so
942
943
    if (firstMatch && !attachedToInput) {
943
944
      nsAutoString buffer;
944
945
 
945
 
      if (NS_FAILED(DecryptData(firstMatch->userValue, buffer)))
946
 
        goto done;
 
946
      if (userField) {
 
947
        if (NS_FAILED(DecryptData(firstMatch->userValue, buffer)))
 
948
          goto done;
947
949
 
948
 
      userField->SetValue(buffer);
 
950
        userField->SetValue(buffer);
 
951
        AttachToInput(userField);
 
952
      }
949
953
 
950
954
      if (NS_FAILED(DecryptData(firstMatch->passValue, buffer)))
951
955
        goto done;
952
956
 
953
957
      passField->SetValue(buffer);
954
 
      AttachToInput(userField);
955
958
    }
956
959
  }
957
960