I like the approach of keeping things flat. That'll make it easier to
add more notification types in the future. However I think we need to
pass more complex information around.
First of all we need to pass information from Gecko to the homescreen
app regarding what to show in the notification. For example for a "Do
you want to allow this application to have access to your camera"
there are several pieces of UI that needs to be rendered:
* The origin of the page displaying the prompt (and if we have an EV
cert, the name of the company which owns the cert).
* The text which describes that camera access is being granted
* Text from the website describing why it's requesting camera access
* The text in the "allow" button
* The text in the "deny" button
* Whether the "remember this decision" checkbox should be checked by
default or not (and possibly whether it should be displayed at all).
* The text for the "remember this decision" checkbox
* An icon
* A title
That is assuming we go with the two-button+checkbox approach.
Currently in Firefox we have a slightly different UI which results in
slightly different set of strings.
For the data passed back to gecko we need the following:
* Which button was pushed
* Whether the "remember this decision" checkbox was checked
Other notifications have other pieces of information. For example the
HTML window.prompt() function causes a notification to be displayed
which has a textbox where the user can enter some information. This
information is then passed back to the page. For that notification we
need the following information:
* The origin of the page displaying the prompt
* The text to display in the dialog
And then we need to pass back to gecko the string that was typed.
Finally there are things like the getUserMedia which will display a
notification similar to the one described here:
http://people.mozilla.com/~jboriss/specs/first_spec.png
This is a significantly different type of notification with
significantly different data being passed back and forth.
The point is that the data we're going to need to pass back and forth
is significantly different based on what type of dialog it is. So we
need to keep the API pretty flexible so that we can pass JSON-objects
back and forth which different type of data for different types of
notifications.
/ Jonas