Closed
Bug 1182514
Opened 9 years ago
Closed 9 years ago
Light-weight kidfox theme
Categories
(Firefox for Android Graveyard :: Profile Handling, defect)
Firefox for Android Graveyard
Profile Handling
Tracking
(firefox42 fixed, firefox43 fixed)
RESOLVED
FIXED
Firefox 43
People
(Reporter: sfang, Assigned: sebastian)
References
Details
Attachments
(1 file, 3 obsolete files)
6.33 KB,
patch
|
sebastian
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Kid style themes, colors, gender-neutral
Possibility bundle add-on?
Comment 1•9 years ago
|
||
Take a look at AMO to see if any existing themes are "kid style" enough to bundle somehow.
Comment 2•9 years ago
|
||
A lightweight theme is really just an image, so we could see if we can "bundle" one and find a way to apply it when launching with a kidfox profile.
I just want to point out there are still some lwt changes (meta: bug 1079416) to be made to improve the experience, specifically bug 1082928 and bug 1082542.
Updated•9 years ago
|
Assignee: nobody → randersen
Reporter | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
Updated•9 years ago
|
Comment 4•9 years ago
|
||
Cloned to 1186027 to move the UX work over to that bug.
Updated•9 years ago
|
Assignee: nobody → ally
Comment 5•9 years ago
|
||
Margaret once played around with using Lightweight Themes from add-ons. Might be useful for this too:
https://github.com/leibovic/privacy-coach/commit/39612a31df29b2da68096b5177919d8d7cb48a45
Comment 6•9 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #5)
> Margaret once played around with using Lightweight Themes from add-ons.
> Might be useful for this too:
> https://github.com/leibovic/privacy-coach/commit/
> 39612a31df29b2da68096b5177919d8d7cb48a45
Thanks, Mark!
Assignee | ||
Comment 7•9 years ago
|
||
This is a quite hacky first patch. It installs the Kinderfox Cyan theme (bug 1191208) from the web for a restricted profile on app start.
Comment 8•9 years ago
|
||
Comment on attachment 8644912 [details] [diff] [review]
1182514-kidfox-theme.patch
installKidFoxTheme -> _installRestrictedTheme or _installParentalControlsTheme
(I'm not a fan of putting codenames in the code)
Updated•9 years ago
|
Assignee: ally → s.kaspari
Reporter | ||
Comment 9•9 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #7)
> Created attachment 8644912 [details] [diff] [review]
> 1182514-kidfox-theme.patch
>
> This is a quite hacky first patch. It installs the Kinderfox Cyan theme (bug
> 1191208) from the web for a restricted profile on app start.
Just to confirm, the light-weight theme is Green, not Cyan :)
Comment 10•9 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #8)
> Comment on attachment 8644912 [details] [diff] [review]
> 1182514-kidfox-theme.patch
>
> installKidFoxTheme -> _installRestrictedTheme or
> _installParentalControlsTheme
>
> (I'm not a fan of putting codenames in the code)
I agree here, but otherwise this patch seems pretty simple. My main concern would be whether or not this affects startup performance, but I assume it won't affect performance any more than a regular theme would.
Assignee | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•9 years ago
|
||
This is the updated and simplified patch for web installation of the theme.
I dug into LightweightThemeManager.jsm to see whether I could load the theme from a local file. It seems like it supports resource:// uris but I couldn't find a way how I could use this to load a shipped file.
Attachment #8644912 -
Attachment is obsolete: true
Attachment #8650478 -
Flags: feedback?(margaret.leibovic)
Comment 12•9 years ago
|
||
Comment on attachment 8650478 [details] [diff] [review]
1182514-kidfox-theme-v2.patch
Review of attachment 8650478 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/chrome/content/browser.js
@@ +3131,5 @@
> },
>
> + _installParentalControlsTheme: function() {
> + this._install({
> + "headerURL": "https://addons.cdn.mozilla.net/user-media/addons/636224/header.png",
I don't like that we'll require a network request to install this theme on first run. I think we should look into how desktop Firefox implements its recommended themes and do that instead. I see code here for that:
http://mxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#198
http://mxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizeMode.jsm#1365
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/defaultthemes/
You're right, we should use a resource: URI. I would look into how desktop Firefox does this and copy that. I'd hope that it would work the same way for Fennec.
Attachment #8650478 -
Flags: feedback?(margaret.leibovic) → feedback-
Assignee | ||
Comment 13•9 years ago
|
||
After reading a lot of code about themes, jars, manifest and the help of MDN I can:
* Package a theme header into the omni.ja
* Create an alias to obtain a resource:// uri to that header
* Install a theme with the resource URI at runtime
* Load the theme's header in Java if I know the complete(!) path inside the JAR(!)
The missing piece is translating a resource URI to the path inside the JAR so that I can pass that to GeckoJarReader. It seems like we do not have anything for that yet.
Right now LightweightThemeManager can handle http/https/file/resource URIs but our LightweightTheme class only knows how to handle http(s) URIs. For extending the functionality with the help of GeckoJarReader I'd need to translate the resource URI to the actual path. But I guess this will require to parse the manifests to lookup the actual path in the JAR?
Assignee | ||
Comment 14•9 years ago
|
||
nalexander gave me the hint to use resource://android/assets/. This seems to work pretty well. I'll finalize the patch based on that.
Assignee | ||
Comment 15•9 years ago
|
||
This patch now adds and installs a built-in theme served from the assets directory.
Attachment #8650478 -
Attachment is obsolete: true
Attachment #8651684 -
Flags: review?(margaret.leibovic)
Comment 16•9 years ago
|
||
Comment on attachment 8651684 [details] [diff] [review]
1182514-kidfox-theme-v3.patch
Review of attachment 8651684 [details] [diff] [review]:
-----------------------------------------------------------------
Nice. I wonder if we could use a similar approach to fix bug 1004517.
::: mobile/android/base/lwt/LightweightTheme.java
@@ +132,5 @@
> + }
> +
> + private Bitmap loadFromAssets(String url) {
> + try {
> + InputStream stream = mApplication.getAssets().open(url.substring(ASSETS_PREFIX.length()));
Do you need to close this stream after you're done with it?
::: mobile/android/chrome/content/browser.js
@@ +3133,5 @@
> + _installParentalControlsTheme: function() {
> + let mgr = this._manager;
> + let parentalControlsTheme = {
> + "headerURL": "resource://android/assets/parental_controls_theme.png",
> + "name": "Parental Controls Theme",
Might be worth noting that we don't localize this because the add-on manager is disabled when parental controls are enabled, so users will never see this.
Although... is it possible for the restricted profile admin to enable add-on installs separately? Maybe we should file a follow-up to localize this for Fx43 (and uplift the non-localized patch).
Attachment #8651684 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 17•9 years ago
|
||
(In reply to :Margaret Leibovic from comment #16)
> ::: mobile/android/base/lwt/LightweightTheme.java
> @@ +132,5 @@
> > + }
> > +
> > + private Bitmap loadFromAssets(String url) {
> > + try {
> > + InputStream stream = mApplication.getAssets().open(url.substring(ASSETS_PREFIX.length()));
>
> Do you need to close this stream after you're done with it?
Oh wow, yeah, definitely. Not sure how this slipped through.. :)
(In reply to :Margaret Leibovic from comment #16)
> Although... is it possible for the restricted profile admin to enable add-on
> installs separately? Maybe we should file a follow-up to localize this for
> Fx43 (and uplift the non-localized patch).
Yeah, the default is to hide it but the admin can enable it. I'll file a follow-up.
Assignee | ||
Comment 18•9 years ago
|
||
url: https://hg.mozilla.org/integration/fx-team/rev/c4cd293d7edd80740c9eae1368821307a7699c45
changeset: c4cd293d7edd80740c9eae1368821307a7699c45
user: Sebastian Kaspari <s.kaspari@gmail.com>
date: Fri Aug 07 13:23:18 2015 +0200
description:
Bug 1182514 - Add Lightweight theme for restricted profiles. r=margaret
Comment 19•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Assignee | ||
Comment 20•9 years ago
|
||
Updating patch to version that landed (for uplift request).
Approval Request Comment
[Feature/regressing bug #]: Bug 1125984
[User impact if declined]: This is the last missing feature for KidFox v1 (Support for restricted profiles) (Bug 1125984). Requesting uplift because KidFox is targeting Fx42.
[Describe test coverage new/current, TreeHerder]: Local testing. Restricted profiles are not covered by UI tests yet.
[Risks and why]: Patch installs and applies a built-in theme at runtime. I verified that the theme is not installed for normal profiles and guest profiles. So I estimate the risk to be low.
[String/UUID change made/needed]: -
Attachment #8651684 -
Attachment is obsolete: true
Attachment #8652354 -
Flags: review+
Attachment #8652354 -
Flags: approval-mozilla-aurora?
Comment 21•9 years ago
|
||
Comment on attachment 8652354 [details] [diff] [review]
1182514-kidfox-theme-v4.patch
Approved for uplift to aurora. We want this for 42 and it looks like many of the kinks have been worked out now.
Attachment #8652354 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Flags: qe-verify+
Updated•9 years ago
|
QA Contact: ioana.chiorean
Comment 22•9 years ago
|
||
status-firefox42:
--- → fixed
Comment 23•6 years ago
|
||
Hello,
Taking into consideration the long period of time since the qe-verify+ flag has been set, I will remove it.
Thank you!
Flags: qe-verify+
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•