This commit is contained in:
hewitt%netscape.com 2002-09-28 01:15:11 +00:00
Родитель 525c6c51ea
Коммит d0bf2af216
3 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -74,8 +74,11 @@ interface nsIAutoCompleteController : nsISupports
/*
* Begin conducting autocomplete behavior on a given input object
*
* @param input - the input object to coordinate searching with
* @param searchString - an optional default string to search for immediately
*/
void attachToInput(in nsIAutoCompleteInput input);
void attachToInput(in nsIAutoCompleteInput input, in AString searchString);
/*
* Detach conductor from the widget it is currently attached to

Просмотреть файл

@ -88,7 +88,7 @@ nsAutoCompleteController::GetMatchCount(PRUint32 *aMatchCount)
}
NS_IMETHODIMP
nsAutoCompleteController::AttachToInput(nsIAutoCompleteInput *aInput)
nsAutoCompleteController::AttachToInput(nsIAutoCompleteInput *aInput, const nsAString &aSearchString)
{
if (!aInput)
return NS_ERROR_ILLEGAL_VALUE;
@ -97,6 +97,7 @@ nsAutoCompleteController::AttachToInput(nsIAutoCompleteInput *aInput)
DetachFromInput();
mInput = aInput;
mSearchString = aSearchString;
// reset all search state members to default values
mSearchString.Truncate(0);

Просмотреть файл

@ -37,7 +37,6 @@
#include "nsFormFillController.h"
#include "nsFormFillResult.h"
#include "nsFormHistory.h"
#include "nsIAutoCompleteResultTypes.h"
#include "nsString.h"
@ -173,8 +172,6 @@ nsFormFillController::AttachToBrowser(nsIDocShell *aDocShell, nsIAutoCompletePop
mDocShells->AppendElement(aDocShell);
mPopups->AppendElement(aPopup);
printf("AttachToBrowser\n");
// Listen for focus events on the domWindow of the docShell
nsCOMPtr<nsIDOMWindow> domWindow = GetWindowForDocShell(aDocShell);
AddFocusListener(domWindow);
@ -617,7 +614,7 @@ nsFormFillController::StartControllingInput(nsIDOMHTMLInputElement *aInput)
AddKeyListener(aInput);
// Now we are the autocomplete controller's bitch
mController->AttachToInput(this);
mController->AttachToInput(this, NS_LITERAL_STRING(""));
}
void