Bug 1306639 - Searching in locationbar by typing something and pressing enter is not accounted in telemetry. r=adw
MozReview-Commit-ID: 9r8IyyyxruC
This commit is contained in:
@@ -89,6 +89,26 @@ nsAutoCompleteController::GetInput(nsIAutoCompleteInput **aInput)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAutoCompleteController::SetInitiallySelectedIndex(int32_t aSelectedIndex)
|
||||
{
|
||||
// First forward to the popup.
|
||||
nsCOMPtr<nsIAutoCompleteInput> input(mInput);
|
||||
NS_ENSURE_STATE(input);
|
||||
nsCOMPtr<nsIAutoCompletePopup> popup;
|
||||
input->GetPopup(getter_AddRefs(popup));
|
||||
NS_ENSURE_STATE(popup);
|
||||
popup->SetSelectedIndex(aSelectedIndex);
|
||||
|
||||
// Now take care of internal stuff.
|
||||
bool completeSelection;
|
||||
if (NS_SUCCEEDED(input->GetCompleteSelectedIndex(&completeSelection)) &&
|
||||
completeSelection) {
|
||||
mCompletedSelectionIndex = aSelectedIndex;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAutoCompleteController::SetInput(nsIAutoCompleteInput *aInput)
|
||||
{
|
||||
@@ -1425,9 +1445,7 @@ nsAutoCompleteController::EnterMatch(bool aIsPopupSelection,
|
||||
// differs from the user-facing value.
|
||||
nsAutoString finalValue;
|
||||
GetResultValueAt(mCompletedSelectionIndex, true, finalValue);
|
||||
nsAutoString completedValue;
|
||||
GetResultValueAt(mCompletedSelectionIndex, false, completedValue);
|
||||
if (completedValue.Equals(inputValue) && !finalValue.Equals(inputValue)) {
|
||||
if (!inputValue.Equals(finalValue)) {
|
||||
value = finalValue;
|
||||
}
|
||||
// Note that if the user opens the popup, mouses over entries without
|
||||
|
||||
Reference in New Issue
Block a user