Closed Bug 895173 Opened 12 years ago Closed 12 years ago

ContextMenu on HomeListView is broken

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: sriram, Assigned: sriram)

References

Details

(Whiteboard: fixed-fig)

Attachments

(2 files, 1 obsolete file)

The "Share" and "Add to Home screen" always uses the url as "about:home" and not the actual list item.
Assignee: nobody → sriram
Attached patch PatchSplinter Review
That was due to name collision. Ideally I thought Fragment would get better precedence in handling the event than the Activity. Unfortunately the activity gets to handle it first and then lets others handle it! Gang-Of-Four fail!! Renamed the menu items so that only HomeFragment can process them. I can go ahead and rename all id's to "home_" if you like it (may be a separate patch on same bug).
Attachment #777445 - Flags: review?(margaret.leibovic)
Comment on attachment 777445 [details] [diff] [review] Patch Review of attachment 777445 [details] [diff] [review]: ----------------------------------------------------------------- That seems like an easy pitfall! Can you add some comments above the onContextItemSelected declaration, explaining that it only gets called if onContextItemSelected in BrowserApp didn't already handle it? I don't think we need to rename everything home_*, since it looks like the other context menu items really are very specific to the homepage. ::: mobile/android/base/home/HomeFragment.java @@ +124,5 @@ > } > > case R.id.open_private_tab: > case R.id.open_new_tab: { > + Log.i("Sriram", "new tab"); Oops, left in some logging :)
Attachment #777445 - Flags: review?(margaret.leibovic) → review+
Whiteboard: fixed-fig
Attached patch OCD (obsolete) — Splinter Review
I was thinking about it day and night.. and somehow the names didn't feel right! So I changed them with all my might.. and putting it for review by your sight!! :P :P
Attachment #779364 - Flags: review?(margaret.leibovic)
Comment on attachment 779364 [details] [diff] [review] OCD Review of attachment 779364 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/resources/menu/top_bookmarks_contextmenu.xml @@ +9,3 @@ > android:title="@string/contextmenu_open_new_tab"/> > > + <item android:id="@+id/home_open_private_tab" I think these should be top_bookmarks_open_new_tab and top_bookmarks_open_private_tab, since that's more consistent with the rest of this file. Also, even though the id conflict issue won't affect these two context menus, it's nice if the ids are different so that we're never confused about the code that handles them.
(In reply to :Margaret Leibovic from comment #5) > Comment on attachment 779364 [details] [diff] [review] > OCD > > Review of attachment 779364 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: mobile/android/base/resources/menu/top_bookmarks_contextmenu.xml > @@ +9,3 @@ > > android:title="@string/contextmenu_open_new_tab"/> > > > > + <item android:id="@+id/home_open_private_tab" > > I think these should be top_bookmarks_open_new_tab and > top_bookmarks_open_private_tab, since that's more consistent with the rest > of this file. > > Also, even though the id conflict issue won't affect these two context > menus, it's nice if the ids are different so that we're never confused about > the code that handles them. I made this "home_" on purpose to reflect the fact that they do the same thing as in HomeFragment. Ideally this should be handled by HomeFragment, but, the ContextMenuInfo's kind changes, and so we want to handle it in BookmarksPage.
Attached patch OCDSplinter Review
Changed.
Attachment #779364 - Attachment is obsolete: true
Attachment #779364 - Flags: review?(margaret.leibovic)
Attachment #779418 - Flags: review?(margaret.leibovic)
Comment on attachment 779418 [details] [diff] [review] OCD Review of attachment 779418 [details] [diff] [review]: ----------------------------------------------------------------- I like that more, thanks.
Attachment #779418 - Flags: review?(margaret.leibovic) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
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: