Closed Bug 737432 Opened 12 years ago Closed 12 years ago

Add permission prompt to b2g

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 742092

People

(Reporter: jstraus, Assigned: jstraus)

Details

Attachments

(2 files, 1 obsolete file)

Gecko needs a way to securely prompt the user for permission to use services.  Once this is done, the hack to always set permissions in b2g.js and b2g/chrome/content/shell.js can be removed.
This is a first pass at getting a UI in place.  More of the infrastructure is filled in so that once we have a good way of putting up a permissions prompt it will be easier to fill in.  It includes a sample call in CameraContent.  I also changed the CID to match nsIContentPermissionPrompt.idl.
showAlertNotification doesn't seem to be working yet, so it is just a place holder.  I considered (and tried) a number of things to get a real UI.  This included a special app to be the dialog, injecting a dialog into each of the apps (like the keyboard), or sending an event to the home screen (somewhat like SMS).  None seems satisfactory.  Suggestions would be welcome.
Attachment #610598 - Flags: review?(fabrice)
Comment on attachment 610598 [details] [diff] [review]
First pass towards providing a UI

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

The general approach is correct. What we need is a way to remote the permission UI call to the homescreen, like we do for the mozNotification and mozApps APIs.

There's a thread on dev-webapi about this subject: http://groups.google.com/group/mozilla.dev.webapi/browse_thread/thread/db29059c5c8e2527#

::: b2g/components/B2GComponents.manifest
@@ +16,1 @@
>  

don't change that. This is the UUID of the interface, which can be implemented by different components that have their own CID.

::: b2g/components/CameraContent.js
@@ +74,5 @@
> +      permprompt.prompt({
> +        type: "content-camera",
> +        uri: principal.URI,
> +        window: null,
> +        element: null,

one of these must be not null.

::: b2g/components/ContentPermissionPrompt.js
@@ +18,1 @@
>  

unused?
Attachment #610598 - Flags: review?(fabrice)
Fabrice:  Fixed the CID.  I thought it fixed a problem I was having earlier, but I guess not.  I tested with the updated CID.  I'm looking at the notification thread you mentioned.  Is there a bug entered for this and/or anyone working on it?  Otherwise, I'll take a stab at getting it started.
Assignee: nobody → jstraus
Attachment #610598 - Attachment is obsolete: true
Attachment #610659 - Flags: review?(fabrice)
bug 742092 added the Gecko <-> gaia glue for ContentPermissionPrompt
Attachment #610659 - Flags: review?(fabrice)
Added more of a UI for permission prompt.
Attachment #613771 - Flags: review?(fabrice)
There is a pull-request in for the gaia changes.
Summary: Add permission prompt to gecko → Add permission prompt to b2g
Comment on attachment 613771 [details] [diff] [review]
more fleshing out the UI

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

https://hg.mozilla.org/integration/mozilla-inbound/rev/6854bda609ae added mostly the same change to b2g/components/ContentPermissionPrompt.js
Can you check if it's enough? We need some gaia tests here.

Also, why do we need to patch browser/* ? this is desktop firefox land, that doesn't have content-camera support and will never have (this will be replaced by webrtc-based code).
Attachment #613771 - Flags: review?(fabrice)
Bug 742092 accomplishes the same thing
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: