Closed Bug 895816 Opened 11 years ago Closed 11 years ago

Tapping "New tab" should immediately create a new tab

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect, P1)

All
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: lucasr, Assigned: Margaret)

References

Details

(Whiteboard: abouthome-hackathon [fixed-fig])

Attachments

(3 files, 2 obsolete files)

...instead of simply entering editing mode. This means that even if you dismiss editing mode, you'd still be in the newly created tab (as opposed to just canceling editing mode).
Blocks: 889620
Whiteboard: abouthome-hackathon
Assignee: nobody → margaret.leibovic
Well, that was quite simple. If you look below, we basically already do the same thing for adding a new private tab.
Attachment #779875 - Flags: review?(lucasr.at.mozilla)
Since we're only ever entering editing mode for the currently open tab, we can get rid of this EditingTarget logic.
Attachment #779878 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 779875 [details] [diff] [review]
(Part 1) Tapping "New tab" should immediately create a new tab

Review of attachment 779875 [details] [diff] [review]:
-----------------------------------------------------------------

Nice and simple. I assume adding tabs from tabs tray and menu both call this very same method?
Attachment #779875 - Flags: review?(lucasr.at.mozilla) → review+
(In reply to Lucas Rocha (:lucasr) from comment #4)
> Comment on attachment 779875 [details] [diff] [review]
> (Part 1) Tapping "New tab" should immediately create a new tab
> 
> Review of attachment 779875 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Nice and simple. I assume adding tabs from tabs tray and menu both call this
> very same method?

Yes, correct.
Comment on attachment 779878 [details] [diff] [review]
(Part 2) Remove EditingTarget because it's no longer needed

Review of attachment 779878 [details] [diff] [review]:
-----------------------------------------------------------------

Nice,

::: mobile/android/base/BrowserApp.java
@@ +1294,5 @@
>          tab.setFaviconLoadId(Favicons.NOT_LOADING);
>      }
>  
> +    public boolean enterEditingMode() {
> +        return enterEditingMode(null, HomePager.Page.BOOKMARKS);

Add an enterEditingMode(HomePager.Page page) and use it here? Just so that these calls look cleaner.

@@ +1303,4 @@
>      }
>  
> +    public boolean enterEditingMode(HomePager.Page page) {
> +        return enterEditingMode(null, page);

Ditto.
Attachment #779878 - Flags: review?(lucasr.at.mozilla) → review+
Now that opening a new tab just loads about:home, loading a URL in a new tab can just follow the regular loadUrl() logic.

testNewTab passes locally for me, but we can wait on the try results before landing this.
Attachment #779910 - Flags: review?(gbrown)
(In reply to Lucas Rocha (:lucasr) from comment #6)
> Comment on attachment 779878 [details] [diff] [review]
> (Part 2) Remove EditingTarget because it's no longer needed
> 
> Review of attachment 779878 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Nice,
> 
> ::: mobile/android/base/BrowserApp.java
> @@ +1294,5 @@
> >          tab.setFaviconLoadId(Favicons.NOT_LOADING);
> >      }
> >  
> > +    public boolean enterEditingMode() {
> > +        return enterEditingMode(null, HomePager.Page.BOOKMARKS);
> 
> Add an enterEditingMode(HomePager.Page page) and use it here? Just so that
> these calls look cleaner.

We already have that right down below. Is it worth the extra method call, rather than just calling directly into the method with the main implementation?

> @@ +1303,4 @@
> >      }
> >  
> > +    public boolean enterEditingMode(HomePager.Page page) {
> > +        return enterEditingMode(null, page);
> 
> Ditto.

Wait... this is the implementation of enterEditingMode(HomePager.Page page), so we can't do that, right?
Attachment #779910 - Flags: review?(gbrown) → review+
This version does a bit more cleaning up...

onSearchRequested is never used anymore, so we can get rid of that. With that gone, enterEditingMode is only called in onActivate and when the user selects the "Paste" context menu. Talking about this on IRC, lucasr and I decided it made sense for us to just always open the VISITED page in these two cases, so we don't need to pass the page as a parameter anymore.
Attachment #779878 - Attachment is obsolete: true
Attachment #780064 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 780064 [details] [diff] [review]
(Part 2) Remove EditingTarget because it's no longer needed (v2)

Review of attachment 780064 [details] [diff] [review]:
-----------------------------------------------------------------

I think onSearchRequested is called when you press the hw search button which is only available on older Android devices. I'd probably keep it around. Looks good otherwise.
Attachment #780064 - Flags: review?(lucasr.at.mozilla) → review+
This version keeps onSearchRequested, although I found that's not actually working properly, even on fig nightly, so I filed bug 897274 about that.
Attachment #780064 - Attachment is obsolete: true
Attachment #780073 - Flags: review?(lucasr.at.mozilla)
Attachment #780073 - Flags: review?(lucasr.at.mozilla) → review+
https://hg.mozilla.org/projects/fig/rev/0ffd6875249b
https://hg.mozilla.org/projects/fig/rev/77efbb48885d
https://hg.mozilla.org/projects/fig/rev/a9f98a5f888f

There are some intermittent oranges on the try run, but I feel like we're okay since testNewTab isn't failing at all (and there's been at least one fully green rc1 and rc2).
Whiteboard: abouthome-hackathon → abouthome-hackathon [fixed-fig]
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: