diff --git a/extensions/wallet/public/nsIWalletService.h b/extensions/wallet/public/nsIWalletService.h index b164bce2897f..c2246536c243 100644 --- a/extensions/wallet/public/nsIWalletService.h +++ b/extensions/wallet/public/nsIWalletService.h @@ -47,7 +47,8 @@ struct nsIWalletService : public nsISupports NS_IMETHOD WALLET_PreEdit(nsIURL* url) = 0; NS_IMETHOD WALLET_ChangePassword() = 0; NS_IMETHOD WALLET_Prefill(nsIPresShell* shell, PRBool quick) = 0; - NS_IMETHOD WALLET_Capture(nsIDocument* doc, nsString name, nsString value) = 0; + NS_IMETHOD WALLET_Capture + (nsIDocument* doc, nsString name, nsString value, nsString vcard) = 0; NS_IMETHOD WALLET_OKToCapture(PRBool* result, PRInt32 count, char* URLName) = 0; NS_IMETHOD SI_DisplaySignonInfoAsHTML()=0; diff --git a/extensions/wallet/src/nsWalletService.cpp b/extensions/wallet/src/nsWalletService.cpp index 55185b256d78..98a00cda86e7 100644 --- a/extensions/wallet/src/nsWalletService.cpp +++ b/extensions/wallet/src/nsWalletService.cpp @@ -77,8 +77,9 @@ NS_IMETHODIMP nsWalletlibService::WALLET_OKToCapture NS_IMETHODIMP nsWalletlibService::WALLET_Capture( nsIDocument* doc, nsString name, - nsString value) { - ::WLLT_Capture(doc, name, value); + nsString value, + nsString vcard) { + ::WLLT_Capture(doc, name, value, vcard); return NS_OK; } diff --git a/extensions/wallet/src/nsWalletService.h b/extensions/wallet/src/nsWalletService.h index 658f4727caee..7973ae8ae9a5 100644 --- a/extensions/wallet/src/nsWalletService.h +++ b/extensions/wallet/src/nsWalletService.h @@ -32,7 +32,8 @@ public: NS_IMETHOD WALLET_ChangePassword(); NS_IMETHOD WALLET_PreEdit(nsIURL* url); NS_IMETHOD WALLET_Prefill(nsIPresShell* shell, PRBool quick); - NS_IMETHOD WALLET_Capture(nsIDocument* doc, nsString name, nsString value); + NS_IMETHOD WALLET_Capture + (nsIDocument* doc, nsString name, nsString value, nsString vcard); NS_IMETHOD WALLET_OKToCapture(PRBool* result, PRInt32 count, char* URLName); NS_IMETHOD SI_DisplaySignonInfoAsHTML(); diff --git a/extensions/wallet/src/wallet.cpp b/extensions/wallet/src/wallet.cpp index c03c8237fe72..2cd56484215f 100644 --- a/extensions/wallet/src/wallet.cpp +++ b/extensions/wallet/src/wallet.cpp @@ -2204,7 +2204,7 @@ WLLT_OKToCapture(PRBool * result, PRInt32 count, char* URLName) { * capture the value of a form element */ PUBLIC void -WLLT_Capture(nsIDocument* doc, nsString field, nsString value) { +WLLT_Capture(nsIDocument* doc, nsString field, nsString value, nsString vcard) { /* do nothing if there is no value */ if (!value.Length()) { @@ -2212,22 +2212,25 @@ WLLT_Capture(nsIDocument* doc, nsString field, nsString value) { } /* read in the mappings if they are not already present */ - wallet_Initialize(); - wallet_InitializeCurrentURL(doc); - if (Wallet_BadKey()) { - return; + if (!vcard.Length()) { + wallet_Initialize(); + wallet_InitializeCurrentURL(doc); + if (Wallet_BadKey()) { + return; + } } nsAutoString oldValue; /* is there a mapping from this field name to a schema name */ - nsAutoString schema; + nsAutoString schema(vcard); XP_List* FieldToSchema_list = wallet_FieldToSchema_list; XP_List* URLFieldToSchema_list = wallet_specificURLFieldToSchema_list; XP_List* SchemaToValue_list = wallet_SchemaToValue_list; XP_List* dummy; - if ((wallet_ReadFromList(field, schema, dummy, URLFieldToSchema_list) != -1) || + if (schema.Length() || + (wallet_ReadFromList(field, schema, dummy, URLFieldToSchema_list) != -1) || (wallet_ReadFromList(field, schema, dummy, FieldToSchema_list) != -1)) { /* field to schema mapping already exists */ @@ -2278,7 +2281,7 @@ WLLT_Capture(nsIDocument* doc, nsString field, nsString value) { //} //PUBLIC void -//WLLT_Capture(nsIDocument* doc, nsString field, nsString value) { +//WLLT_Capture(nsIDocument* doc, nsString field, nsString value, nsString vcard) { //} //} diff --git a/extensions/wallet/src/wallet.h b/extensions/wallet/src/wallet.h index 858ce037bed7..c398c616358c 100644 --- a/extensions/wallet/src/wallet.h +++ b/extensions/wallet/src/wallet.h @@ -46,7 +46,7 @@ extern void WLLT_OKToCapture(PRBool * result, PRInt32 count, char* URLName); extern void -WLLT_Capture(nsIDocument* doc, nsString name, nsString value); +WLLT_Capture(nsIDocument* doc, nsString name, nsString value, nsString vcard); XP_END_PROTOS diff --git a/layout/html/forms/src/nsFormFrame.cpp b/layout/html/forms/src/nsFormFrame.cpp index b9cd7b4e2d9b..24afe8232244 100644 --- a/layout/html/forms/src/nsFormFrame.cpp +++ b/layout/html/forms/src/nsFormFrame.cpp @@ -812,12 +812,15 @@ void nsFormFrame::ProcessAsURLEncoded(PRBool isPost, nsString& aData, nsIFormCon #endif #ifdef ClientWallet if (OKToCapture && (NS_FORM_INPUT_TEXT == type)) { + nsString vcard(""); +/* following line is awaiting karneze to implement GetAttrib */ +// child->GetAttrib(NS_NewAtom("VCARD_NAME"), &vcard); nsIWalletService *service; nsresult res = nsServiceManager::GetService(kWalletServiceCID, kIWalletServiceIID, (nsISupports **)&service); if ((NS_OK == res) && (nsnull != service)) { - res = service->WALLET_Capture(doc, *names, *values); + res = service->WALLET_Capture(doc, *names, *values, vcard); NS_RELEASE(service); } }