2012-05-21 15:12:37 +04: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-16 03:37:48 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-07-30 18:58:26 +04:00
|
|
|
interface nsIPrincipal;
|
2016-01-30 20:05:36 +03:00
|
|
|
interface mozIDOMWindow;
|
2014-02-10 00:34:40 +04:00
|
|
|
interface nsIArray;
|
2008-07-16 03:37:48 +04:00
|
|
|
|
2018-04-27 06:36:10 +03:00
|
|
|
webidl Element;
|
|
|
|
|
2008-07-16 03:37:48 +04:00
|
|
|
/**
|
2014-02-10 00:34:40 +04:00
|
|
|
* Interface provides the request type and its access.
|
2008-07-16 03:37:48 +04:00
|
|
|
*/
|
2013-09-10 19:41:59 +04:00
|
|
|
[scriptable, uuid(ef4db3b8-ca9c-4b1d-8f81-fd88ec32af13)]
|
2014-02-10 00:34:40 +04:00
|
|
|
interface nsIContentPermissionType : nsISupports {
|
2010-09-10 08:59:51 +04:00
|
|
|
/**
|
|
|
|
* The type of the permission request, such as
|
|
|
|
* "geolocation".
|
|
|
|
*/
|
|
|
|
readonly attribute ACString type;
|
|
|
|
|
2013-09-10 19:41:59 +04:00
|
|
|
/**
|
|
|
|
* The array of available options.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIArray options; // ["choice1", "choice2"]
|
2014-02-10 00:34:40 +04:00
|
|
|
};
|
2012-11-14 04:06:42 +04:00
|
|
|
|
2015-04-14 04:08:00 +03:00
|
|
|
/**
|
|
|
|
* Interface provides the callback type.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(5fb5bb60-7069-11e4-9803-0800200c9a66)]
|
|
|
|
interface nsIContentPermissionRequestCallback : nsISupports {
|
|
|
|
/**
|
|
|
|
* The callback of the visibility result.
|
|
|
|
*/
|
|
|
|
void notifyVisibility(in boolean isVisible);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface provides the way to get the visibility and
|
|
|
|
* the notification.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(f8577124-6a5f-486f-ae04-c5bcae911eb5)]
|
|
|
|
interface nsIContentPermissionRequester : nsISupports {
|
|
|
|
/**
|
|
|
|
* The function to get the visibility.
|
|
|
|
*/
|
|
|
|
void getVisibility(in nsIContentPermissionRequestCallback callback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The callback to get the notification of visibility change.
|
|
|
|
*/
|
|
|
|
attribute nsIContentPermissionRequestCallback onVisibilityChange;
|
|
|
|
};
|
|
|
|
|
2014-02-10 00:34:40 +04:00
|
|
|
/**
|
|
|
|
* Interface allows access to a content to request
|
|
|
|
* permission to perform a privileged operation such as
|
|
|
|
* geolocation.
|
|
|
|
*/
|
2016-01-30 20:05:36 +03:00
|
|
|
[scriptable, uuid(875733da-0ac0-4a26-8c76-70a30876be46)]
|
2014-02-10 00:34:40 +04:00
|
|
|
interface nsIContentPermissionRequest : nsISupports {
|
2010-09-10 08:59:51 +04:00
|
|
|
/**
|
2014-02-10 00:34:40 +04:00
|
|
|
* The array will include the request types. Elements of this array are
|
|
|
|
* nsIContentPermissionType object.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIArray types;
|
|
|
|
|
|
|
|
/*
|
2012-07-30 18:58:26 +04:00
|
|
|
* The principal of the permission request.
|
2010-09-10 08:59:51 +04:00
|
|
|
*/
|
2012-07-30 18:58:26 +04:00
|
|
|
readonly attribute nsIPrincipal principal;
|
2008-07-16 03:37:48 +04:00
|
|
|
|
2018-11-20 04:52:47 +03:00
|
|
|
/*
|
|
|
|
* The principal of the top-level page the permission request comes from.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIPrincipal topLevelPrincipal;
|
|
|
|
|
2010-09-10 08:59:51 +04: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.
|
|
|
|
*/
|
2016-01-30 20:05:36 +03:00
|
|
|
readonly attribute mozIDOMWindow window;
|
2018-04-27 06:36:10 +03:00
|
|
|
readonly attribute Element element;
|
2008-07-16 03:37:48 +04:00
|
|
|
|
2017-02-20 22:46:39 +03:00
|
|
|
readonly attribute boolean isHandlingUserInput;
|
|
|
|
|
2015-04-14 04:08:00 +03:00
|
|
|
/**
|
|
|
|
* The requester to get the required information of
|
|
|
|
* the window.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIContentPermissionRequester requester;
|
|
|
|
|
2010-09-10 08:59:51 +04:00
|
|
|
/**
|
|
|
|
* allow or cancel the request
|
|
|
|
*/
|
2010-05-13 21:44:51 +04:00
|
|
|
|
2008-07-16 03:37:48 +04:00
|
|
|
void cancel();
|
2013-09-10 19:41:59 +04:00
|
|
|
void allow([optional] in jsval choices); // {"type1": "choice1", "type2": "choiceA"}
|
2008-07-16 03:37:48 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface provides a way for the application to handle
|
2008-08-14 20:35:49 +04:00
|
|
|
* the UI prompts associated with geo position.
|
2008-07-16 03:37:48 +04:00
|
|
|
*/
|
2010-09-10 08:59:51 +04:00
|
|
|
[scriptable, function, uuid(F72DE90D-E954-4E69-9A61-917303029301)]
|
|
|
|
interface nsIContentPermissionPrompt : nsISupports {
|
2008-07-16 03:37:48 +04:00
|
|
|
/**
|
2010-09-10 08:59:51 +04:00
|
|
|
* Called when a request has been made to access
|
|
|
|
* privileged content apis
|
2008-07-16 03:37:48 +04:00
|
|
|
*/
|
2010-09-10 08:59:51 +04:00
|
|
|
void prompt(in nsIContentPermissionRequest request);
|
2008-07-16 03:37:48 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
2010-09-10 08:59:51 +04:00
|
|
|
#define NS_CONTENT_PERMISSION_PROMPT_CONTRACTID "@mozilla.org/content-permission/prompt;1"
|
2008-07-16 03:37:48 +04:00
|
|
|
%}
|