Closed Bug 909375 Opened 11 years ago Closed 11 years ago

Regression: Use website URL when title not available for about:home item context menu header

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

26 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox26 verified)

VERIFIED FIXED
Firefox 26
Tracking Status
firefox26 --- verified

People

(Reporter: aaronmt, Assigned: sriram)

References

Details

(Keywords: regression)

Attachments

(3 files)

Attached image New | Old - Screenshot
Currently listed sites without available titles to use do not expose a menu item header in the about:home context menu. In the old about:home, the URL was just used. See screenshot URL I used for testing; http://account.live.com which does a redirect and the entry gets added to our places database -- Nightly (08/26) | LG Nexus 4 (Android 4.3)
Attached patch PatchSplinter Review
I stole some piece of code from shortcut title creation. This removes "http(s)://www." from the urls when showing as title -- same as shortcut title.
Attachment #795747 - Flags: review?(margaret.leibovic)
Comment on attachment 795747 [details] [diff] [review] Patch Review of attachment 795747 [details] [diff] [review]: ----------------------------------------------------------------- This gets the job done, but I think it can be better :) ::: mobile/android/base/home/HomeFragment.java @@ +85,5 @@ > > MenuInflater inflater = new MenuInflater(view.getContext()); > inflater.inflate(R.menu.home_contextmenu, menu); > > + final String headerTitle = TextUtils.isEmpty(info.title) ? info.url.replaceAll(REGEX_URL_TO_TITLE, "") : info.title; This is exactly the same as the line to make shortcutTitle, and I think it's complex enough that it makes sense to pull it out into a helper method, maybe something like getDisplayTitle(). Or should we consider setting the title like this in the HomeContextMenuInfo constructor? It looks like this empty title problem might also be an issue for launching a share intent: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/home/HomeFragment.java#128 Unless you foresee any problems with that, I think that would actually be the best solution.
Attachment #795747 - Flags: review?(margaret.leibovic) → feedback+
This is not for share title. I thought of moving it to a helper method. But then its a bit extra work for a one-liner. So went ahead and added that one line here. Do you really want a helper method for a one-liner?
(In reply to Sriram Ramasubramanian [:sriram] from comment #3) > This is not for share title. I thought of moving it to a helper method. But > then its a bit extra work for a one-liner. So went ahead and added that one > line here. Do you really want a helper method for a one-liner? I know this fix isn't for the share title, but I was wondering if that is another bug that we could address with a more general fix here. We currently only use info.title for the shortcut title, this header title, and the share intent title, so if we want them to all do the same thing, I see an opportunity for us to just fix them all in one place (the HomeContextMenuInfo constructor). In fact, I think we should do this, since this is what we're already doing for the main menu share item: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserApp.java#826
Attached patch PatchSplinter Review
This is so clean - Hope I had already seen!
Attachment #796299 - Flags: review?(margaret.leibovic)
Comment on attachment 796299 [details] [diff] [review] Patch Review of attachment 796299 [details] [diff] [review]: ----------------------------------------------------------------- Nice, this is what I had in mind.
Attachment #796299 - Flags: review?(margaret.leibovic) → review+
Assignee: nobody → sriram
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: