Closed Bug 944533 Opened 12 years ago Closed 12 years ago

Re-implement toolbar's display UI state management

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: lucasr, Assigned: lucasr)

References

Details

Attachments

(7 files, 3 obsolete files)

1001 bytes, patch
Margaret
: review+
Details | Diff | Splinter Review
4.29 KB, patch
Margaret
: review+
Details | Diff | Splinter Review
4.00 KB, patch
Margaret
: review+
Details | Diff | Splinter Review
24.00 KB, patch
Margaret
: review+
mfinkle
: review+
Details | Diff | Splinter Review
1.11 KB, patch
Margaret
: review+
Details | Diff | Splinter Review
22.16 KB, patch
Margaret
: review+
Details | Diff | Splinter Review
12.00 KB, patch
Margaret
: review+
mfinkle
: feedback+
Details | Diff | Splinter Review
Current internal API to update the state of the toolbar display UI (throbber, favicon, title, stop, page actions) is confusing. Ideally, we should have a single entry point to update the state of the toolbar based on the selected tab instead of scattering this code into multiple unrelated methods.
Depends on: 944537
Depends on: 942862
Comment on attachment 8341625 [details] [diff] [review] No need to set progress visibility explicitly in BrowserApp (r=margaret) The new Tab's state will do that for us anyway as it will be immediately selected on the Java side.
Attachment #8341625 - Flags: review?(margaret.leibovic)
Comment on attachment 8341626 [details] [diff] [review] Make unnecessary public API in BrowserToolbar private (r=margaret) Seal BrowserToolbar a bit more before redoing its guts.
Attachment #8341626 - Flags: review?(margaret.leibovic)
Comment on attachment 8341627 [details] [diff] [review] Inflate SiteIdentityPopup on show() and add identity setter (r=margaret) Change the SiteIdentityPopup API a bit. The core intent here is change SiteIdentityPopup to hold its necessary data. This looks cleaner now that site identity/security mode is encapsulated behind a proper API (bug 945212).
Attachment #8341627 - Flags: review?(margaret.leibovic)
Comment on attachment 8341628 [details] [diff] [review] Re-define internal API to update toolbar UI state (r=mfinkle) Here's the what the new internal API does: - Creates a single entry point to update ToolbarDisplayLayout's state from a tab instance i.e. the updateFromTab(). - The point here is to make ToolbarDisplayLayout as dummo/stateless/functional as possible. We only hold enough state to be able to short-circuit/optimize certain code paths e.g. avoid UI unnecessary changes. - Reduce the amount of dependencies in ToolbarDisplayLayout as much as possible. For instance, it doesn't depend on things like the Tabs API at all. It only acts on the given Tab instance in updateFromTab(). The title handling is refactored in separate patches because it requires some extra steps (see following patches).
Attachment #8341628 - Flags: review?(mark.finkle)
Attachment #8341628 - Flags: review?(margaret.leibovic)
Attachment #8341629 - Flags: review?(margaret.leibovic)
Attachment #8341630 - Attachment is obsolete: true
Attachment #8341631 - Attachment is obsolete: true
Attachment #8341653 - Flags: review?(margaret.leibovic)
Comment on attachment 8341654 [details] [diff] [review] Move title handling to ToolbarDisplayLayout (r=margaret) Now ToolbarDisplayLayout manages all its state behind a single API, updateFromTab().
Attachment #8341654 - Flags: review?(margaret.leibovic)
Attachment #8341625 - Flags: review?(margaret.leibovic) → review+
Attachment #8341626 - Flags: review?(margaret.leibovic) → review+
Attachment #8341627 - Flags: review?(margaret.leibovic) → review+
Attachment #8341629 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8341653 [details] [diff] [review] Factor out title display prefs into separate class (r=margaret) Review of attachment 8341653 [details] [diff] [review]: ----------------------------------------------------------------- Oops, looks like you forgot to hg add ToolbarTitlePrefs :)
Attachment #8341653 - Flags: review?(margaret.leibovic)
Comment on attachment 8341653 [details] [diff] [review] Factor out title display prefs into separate class (r=margaret) Missing ToolbarTitlePrefs.java If you are migrating the title handling to ToolbarDisplayLayout, maybe the prefs could just live there instead of a separate class?
Comment on attachment 8341628 [details] [diff] [review] Re-define internal API to update toolbar UI state (r=mfinkle) This looks OK to me. I took a quick look at all the other patches to get more context. I like the way the code is organizing. I like the way we could optimize some of the toolbar UI operations too. Question: Is this low-risk enough to take on mozilla-central so close to a merge?
Attachment #8341628 - Flags: review?(mark.finkle) → review+
I love it! I think this is moving in the direction of Bug 946330, so blocking that.
Blocks: 946330
Comment on attachment 8342515 [details] [diff] [review] Factor out title display prefs into separate class (r=margaret) Now with all the files :-)
Attachment #8342515 - Flags: review?(mark.finkle)
Attachment #8342515 - Flags: review?(margaret.leibovic)
Attachment #8341653 - Attachment is obsolete: true
(In reply to Mark Finkle (:mfinkle) from comment #17) > Question: Is this low-risk enough to take on mozilla-central so close to a > merge? This is actually risky enough that we should avoid landing it just before the merge. Besides, these patches provide no user visible benefit. So, no need to hurry.
Attachment #8342515 - Flags: review?(mark.finkle) → feedback+
Comment on attachment 8341628 [details] [diff] [review] Re-define internal API to update toolbar UI state (r=mfinkle) Review of attachment 8341628 [details] [diff] [review]: ----------------------------------------------------------------- It's hard to review patches that are based on code that hasn't landed yet, but this seems reasonable to me. Also, landing this early in the cycle makes me feel better about having time to shake out regressions.
Attachment #8341628 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8342515 [details] [diff] [review] Factor out title display prefs into separate class (r=margaret) Review of attachment 8342515 [details] [diff] [review]: ----------------------------------------------------------------- Nice reorganization.
Attachment #8342515 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8341654 [details] [diff] [review] Move title handling to ToolbarDisplayLayout (r=margaret) Review of attachment 8341654 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/toolbar/BrowserToolbar.java @@ +272,5 @@ > + } else { > + contentDescription = mActivity.getString(R.string.url_bar_default_text); > + } > + > + setContentDescription(contentDescription); You should add a comment about why we need to set the content description here, rather than where we actually update the title (this was a question I had when I first looked at this). ::: mobile/android/base/toolbar/ToolbarDisplayLayout.java @@ +50,5 @@ > implements Animation.AnimationListener { > > private static final String LOGTAG = "GeckoToolbarDisplayLayout"; > > enum UpdateFlags { As a follow-up (mentor bug?), it would be nice to add some docs here to explain what these flags mean in practice.
Attachment #8341654 - Flags: review?(margaret.leibovic) → review+
FYI: Just waiting for a final review from wesj in bug 942862 to land this. All green on try: https://tbpl.mozilla.org/?tree=Try&rev=3a33a65bf136
(In reply to :Margaret Leibovic from comment #24) > Comment on attachment 8341654 [details] [diff] [review] > Move title handling to ToolbarDisplayLayout (r=margaret) > > Review of attachment 8341654 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: mobile/android/base/toolbar/BrowserToolbar.java > @@ +272,5 @@ > > + } else { > > + contentDescription = mActivity.getString(R.string.url_bar_default_text); > > + } > > + > > + setContentDescription(contentDescription); > > You should add a comment about why we need to set the content description > here, rather than where we actually update the title (this was a question I > had when I first looked at this). Done. > ::: mobile/android/base/toolbar/ToolbarDisplayLayout.java > @@ +50,5 @@ > > implements Animation.AnimationListener { > > > > private static final String LOGTAG = "GeckoToolbarDisplayLayout"; > > > > enum UpdateFlags { > > As a follow-up (mentor bug?), it would be nice to add some docs here to > explain what these flags mean in practice. Working on javadocs for the toolbar high-level architecture. Filed bug 957992 to track this.
hi, had to backout this change as part of https://tbpl.mozilla.org/?tree=Fx-Team&rev=e89b407be9c5 because of build bustages on android and windows like https://tbpl.mozilla.org/php/getParsedLog.php?id=32753197&tree=Fx-Team
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: