2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-07-15 16:37:48 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-07-30 07:58:26 -07:00
|
|
|
interface nsIPrincipal;
|
2008-07-15 16:37:48 -07:00
|
|
|
interface nsIDOMWindow;
|
2010-05-13 10:44:51 -07:00
|
|
|
interface nsIDOMElement;
|
2008-07-15 16:37:48 -07:00
|
|
|
|
|
|
|
/**
|
2010-09-09 21:59:51 -07:00
|
|
|
* Interface allows access to a content to request
|
|
|
|
* permission to perform a privileged operation such as
|
|
|
|
* geolocation.
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
2012-07-30 07:58:26 -07:00
|
|
|
[scriptable, uuid(E1F3796C-ADFA-414B-B2A7-AC62F29395EE)]
|
2010-09-09 21:59:51 -07:00
|
|
|
interface nsIContentPermissionRequest : nsISupports {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the permission request, such as
|
|
|
|
* "geolocation".
|
|
|
|
*/
|
|
|
|
readonly attribute ACString type;
|
|
|
|
|
|
|
|
/**
|
2012-07-30 07:58:26 -07:00
|
|
|
* The principal of the permission request.
|
2010-09-09 21:59:51 -07:00
|
|
|
*/
|
2012-07-30 07:58:26 -07:00
|
|
|
readonly attribute nsIPrincipal principal;
|
2008-07-15 16:37:48 -07:00
|
|
|
|
2010-09-09 21:59:51 -07:00
|
|
|
/**
|
|
|
|
* The window or element that the permission request was
|
|
|
|
* originated in. Typically the element will be non-null
|
|
|
|
* in when using out of process content. window or
|
|
|
|
* element can be null but not both.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMWindow window;
|
|
|
|
readonly attribute nsIDOMElement element;
|
2008-07-15 16:37:48 -07:00
|
|
|
|
2010-09-09 21:59:51 -07:00
|
|
|
/**
|
|
|
|
* allow or cancel the request
|
|
|
|
*/
|
2010-05-13 10:44:51 -07:00
|
|
|
|
2008-07-15 16:37:48 -07:00
|
|
|
void cancel();
|
|
|
|
void allow();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface provides a way for the application to handle
|
2008-08-14 09:35:49 -07:00
|
|
|
* the UI prompts associated with geo position.
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
2010-09-09 21:59:51 -07:00
|
|
|
[scriptable, function, uuid(F72DE90D-E954-4E69-9A61-917303029301)]
|
|
|
|
interface nsIContentPermissionPrompt : nsISupports {
|
2008-07-15 16:37:48 -07:00
|
|
|
/**
|
2010-09-09 21:59:51 -07:00
|
|
|
* Called when a request has been made to access
|
|
|
|
* privileged content apis
|
2008-07-15 16:37:48 -07:00
|
|
|
*/
|
2010-09-09 21:59:51 -07:00
|
|
|
void prompt(in nsIContentPermissionRequest request);
|
2008-07-15 16:37:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2010-09-09 21:59:51 -07:00
|
|
|
#define NS_CONTENT_PERMISSION_PROMPT_CONTRACTID "@mozilla.org/content-permission/prompt;1"
|
2008-07-15 16:37:48 -07:00
|
|
|
%}
|