Closed Bug 679194 Opened 8 years ago Closed 8 years ago

Add a permission prompt for mozApps.mgmt.list and mozApps.mgmt.uninstall

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 9

People

(Reporter: fabrice, Assigned: fabrice)

References

Details

Attachments

(1 file, 2 obsolete files)

These API calls (from https://developer.mozilla.org/en/OpenWebApps/The_JavaScript_API) allow access to private data or to remove some, so  we need to add permission prompts.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → fabrice
This patch applies on top of the patch in bug 609043
Attachment #553298 - Flags: review?(mbrubeck)
Comment on attachment 553298 [details] [diff] [review]
patch

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

::: mobile/chrome/content/common-ui.js
@@ +1740,5 @@
> +    switch(perm) {
> +      case Ci.nsIPermissionManager.ALLOW_ACTION:
> +        aCallbacks.allow();
> +        return;
> +        break;

Leave out "break" after "return".

@@ +1744,5 @@
> +        break;
> +      case Ci.nsIPermissionManager.DENY_ACTION:
> +        aCallbacks.cancel();
> +        return;
> +        break;

Ditto.
Attachment #553298 - Flags: review?(mbrubeck) → review+
This landed earlier as http://hg.mozilla.org/mozilla-central/rev/c51c5db7903f

However, I had to back out bug 609043 (see that bug for details), and this stacks on top of that, so I backed this out:
  http://hg.mozilla.org/mozilla-central/rev/51c50cf19742
Attached patch updated patch (obsolete) — Splinter Review
Attachment #553298 - Attachment is obsolete: true
Attachment #561874 - Flags: review?(mark.finkle)
Comment on attachment 561874 [details] [diff] [review]
updated patch

Lets just merge the "uninstall" and "list" permissions into "manage"

openWebAppsManage ?

>diff --git a/mobile/locales/en-US/chrome/browser.properties b/mobile/locales/en-US/chrome/browser.properties

>+# Open Web Apps management API
>+openWebappsUninstall.allow=Allow
>+openWebappsUninstall.dontAllow=Don't Allow
>+openWebappsUninstall.wantsTo=%S wants to uninstall an application on your device.
>+openWebappsList.allow=Allow
>+openWebappsList.dontAllow=Don't Allow
>+openWebappsList.wantsTo=%S wants to retrieve the list of applications on your device.
>+

  openWebappsManage.wantsTo=%S wants to manage applications on your device.


r- just because I want to see the updated patch
Attachment #561874 - Flags: review?(mark.finkle) → review-
Attached patch updated patchSplinter Review
Merging permissions into a single one. I kept the code structure allowing different permissions if we want to change our minds later.
Attachment #561874 - Attachment is obsolete: true
Attachment #562193 - Flags: review?(mark.finkle)
Comment on attachment 562193 [details] [diff] [review]
updated patch

>diff --git a/mobile/locales/en-US/chrome/browser.properties b/mobile/locales/en-US/chrome/browser.properties

> pageactions.offline-app=Offline Storage
> pageactions.password=Password
> pageactions.desktop-notification=Web Notifications
>+pageactions.openWebappsUninstall=Uninstalling Open Web Apps
>+pageactions.openWebappsList=Listing Open Web Apps

I think we want pageactions.openWebappsManage=Manage Web Apps

(dropping the "Open" part from the text)

r+ with that change
Attachment #562193 - Flags: review?(mark.finkle) → review+
Good catch... I verified that it appears correctly in the site menu with this change.
https://hg.mozilla.org/mozilla-central/rev/d8a22be1e9c7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 9
Depends on: 669806
Whiteboard: QA?
Camelia, you can try my demo at http://aaronmt.com/webapp.html, you should get the prompts for permissions
Whiteboard: QA? → QA+
Mozilla/5.0 (Android; Linux armv7l; rv:9.0a2) Gecko/20111013 Firefox/9.0a2 Fennec/9.0a2

Mozilla/5.0 (Android; Linux armv7l; rv:10.0a1) Gecko/20111013 Firefox/10.0a1 Fennec/10.0a1

Device: HTC Desire Z - Android 2.3

Verified on: http://aaronmt.com/webapp.html, permission prompts are displayed.
Status: RESOLVED → VERIFIED
Whiteboard: QA+
You need to log in before you can comment on or make changes to this bug.