Closed Bug 515451 Opened 11 years ago Closed 11 years ago

make places autocomplete empty search behavior customizable

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: Gavin, Assigned: Gavin)

References

Details

Attachments

(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 → gavin.sharp
Status: NEW → ASSIGNED
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]
patch

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

r=Mardak

Add tests to test_empty_search:
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/autocomplete/test_empty_search.js

You can use the pattern from test_special_search to change the prefs and search.
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/tests/autocomplete/test_special_search.js#166
Attached patch with testSplinter Review
Attachment #399554 - Attachment is obsolete: true
Attachment #399554 - Flags: review?(mak77)
http://hg.mozilla.org/mozilla-central/rev/f321d600290d
Status: ASSIGNED → RESOLVED
Closed: 11 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?

browser.urlbar.default.behavior
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.