NS_IMETHODIMP WalletPreviewImpl::SetValue(const PRUnichar* aValue, nsIDOMWindowInternal* win) { /* close the window */ if (!win) { return NS_ERROR_FAILURE; } nsIDOMWindow* top; win->GetTop(&top); if (!top) { return NS_ERROR_FAILURE; } nsCOMPtr<nsIDocShellTreeOwner> treeOwner; DOMWindowToTreeOwner(top, getter_AddRefs(treeOwner)); nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_QueryInterface(treeOwner)); if (treeOwnerAsWin) { treeOwnerAsWin->Destroy(); } NS_RELEASE(top); /* process the value */ NS_PRECONDITION(aValue != nsnull, "null ptr"); if (! aValue) { return NS_ERROR_NULL_POINTER; } nsresult res; nsCOMPtr<nsIWalletService> walletservice = do_GetService(kWalletServiceCID, &res); if (NS_FAILED(res)) return res; nsAutoString walletList( aValue ); res = walletservice->WALLET_PrefillReturn(walletList); return res; }
NS_IMETHODIMP WalletEditorImpl::SetValue(const PRUnichar* aValue, nsIDOMWindowInternal* win) { /* process the value */ NS_PRECONDITION(aValue != nsnull, "null ptr"); if (! aValue) { return NS_ERROR_NULL_POINTER; } nsresult res; nsCOMPtr<nsIWalletService> walletservice = do_GetService(kWalletServiceCID, &res); if (NS_FAILED(res)) return res; nsAutoString walletList( aValue ); res = walletservice->WALLET_PostEdit(walletList); return res; }