Closed Bug 515451 Opened 12 years ago Closed 12 years ago

make places autocomplete empty search behavior customizable


(Toolkit :: Places, defect)

Not set



Tracking Status
status1.9.2 --- beta1-fixed


(Reporter: Gavin, Assigned: Gavin)




(1 file, 2 obsolete files)

Right now places autocomplete restricts empty searches to typed history items. Fennec would like unvisited bookmarks to appear in empty searches, so I'd like to make that customizable with a pref.
Attached patch patch (obsolete) — Splinter Review
I decided to have the behavior be fully customizable rather than just additive to the default behavior, which allows more flexibility and is slightly simpler.
Assignee: nobody →
Attachment #399545 - Flags: review?(edilee)
So we ignore the default behavior/user preference (Privacy -> Location bar suggestions) when the user clicks the dropdown?

The only badness that can occur is if the user selects "Bookmarks" and clicking the dropdown will now show history.

(For the other cases, "History & Bookmarks" is actually "0" and "History" is 1 (?), so just using empty behavior will be correct because it's "33" (32 | 1) and covers both those cases. "None" just turns off the location bar entirely.)
Comment on attachment 399545 [details] [diff] [review]

i'd just rename this._emptyDefaultBehavior to this._emptySearchDefaultBehavior

since the former is unclear without looking at the definition.
Attachment #399545 - Flags: review?(edilee) → review+
Attachment #399545 - Flags: review+ → review?(edilee)
Attachment #399545 - Attachment is obsolete: true
Attachment #399554 - Flags: review?(mak77)
Attachment #399554 - Flags: review?(edilee)
Attachment #399545 - Flags: review?(edilee)
Comment on attachment 399554 [details] [diff] [review]
have empty behavior inherit default behavior

fine for me.
Attachment #399554 - Flags: review?(mak77) → review+
Attachment #399554 - Flags: review?(edilee) → review?(mak77)
Comment on attachment 399554 [details] [diff] [review]
have empty behavior inherit default behavior


Add tests to test_empty_search:

You can use the pattern from test_special_search to change the prefs and search.
Attached patch with testSplinter Review
Attachment #399554 - Attachment is obsolete: true
Attachment #399554 - Flags: review?(mak77)
Closed: 12 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Comment on attachment 399577 [details] [diff] [review]
with test

Want this for Fennec
Attachment #399577 - Flags: approval1.9.2?
Is there any change here by using a different number for this pref?

1: history
2: bookmarked
4: match tag
8: match title
16: match URL
32: match typed

so you want 1+32 = 33
I don't understand your comment. The patch uses 33 as a default. That matches the previous behavior.
Yes, changing browser.urlbar.default.behavior to 33 will limit normal awesomebar searches to typed history items, if that's what your asking.
Attachment #399577 - Flags: approval1.9.2? → approval1.9.2+
You need to log in before you can comment on or make changes to this bug.