|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nspluginroot.idl" |
|
7 #include "nsISupports.idl" |
|
8 #include "nsIPluginTag.idl" |
|
9 |
|
10 %{C++ |
|
11 #define MOZ_PLUGIN_HOST_CONTRACTID \ |
|
12 "@mozilla.org/plugin/host;1" |
|
13 %} |
|
14 |
|
15 [scriptable, uuid(f89e7679-0adf-4a30-bda9-1afe1ee270d6)] |
|
16 interface nsIPluginPlayPreviewInfo : nsISupports |
|
17 { |
|
18 readonly attribute AUTF8String mimeType; |
|
19 readonly attribute boolean ignoreCTP; |
|
20 readonly attribute AUTF8String redirectURL; |
|
21 }; |
|
22 |
|
23 [scriptable, uuid(e8fe94f0-b877-46d0-931a-090967fb1e83)] |
|
24 interface nsIPluginHost : nsISupports |
|
25 { |
|
26 /** |
|
27 * Causes the plugins directory to be searched again for new plugin |
|
28 * libraries. |
|
29 */ |
|
30 void reloadPlugins(); |
|
31 |
|
32 void getPluginTags([optional] out unsigned long aPluginCount, |
|
33 [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults); |
|
34 |
|
35 /* |
|
36 * Flags for use with clearSiteData. |
|
37 * |
|
38 * FLAG_CLEAR_ALL: clear all data associated with a site. |
|
39 * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without |
|
40 * loss of functionality. To be used out of concern for |
|
41 * space and not necessarily privacy. |
|
42 */ |
|
43 const uint32_t FLAG_CLEAR_ALL = 0; |
|
44 const uint32_t FLAG_CLEAR_CACHE = 1; |
|
45 |
|
46 /* |
|
47 * Clear site data for a given plugin. |
|
48 * |
|
49 * @param plugin: the plugin to clear data for, such as one returned by |
|
50 * nsIPluginHost.getPluginTags. |
|
51 * @param domain: the domain to clear data for. If this argument is null, |
|
52 * clear data for all domains. Otherwise, it must be a domain |
|
53 * only (not a complete URI or IRI). The base domain for the |
|
54 * given site will be determined; any data for the base domain |
|
55 * or its subdomains will be cleared. |
|
56 * @param flags: a flag value defined above. |
|
57 * @param maxAge: the maximum age in seconds of data to clear, inclusive. If |
|
58 * maxAge is 0, no data is cleared; if it is -1, all data is |
|
59 * cleared. |
|
60 * |
|
61 * @throws NS_ERROR_INVALID_ARG if the domain argument is malformed. |
|
62 * @throws NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED if maxAge is a value other |
|
63 * than -1 and the plugin does not support clearing by timerange in |
|
64 * general or for that particular site and/or flag combination. |
|
65 */ |
|
66 void clearSiteData(in nsIPluginTag plugin, in AUTF8String domain, |
|
67 in uint64_t flags, in int64_t maxAge); |
|
68 |
|
69 /* |
|
70 * Determine if a plugin has stored data for a given site. |
|
71 * |
|
72 * @param plugin: the plugin to query, such as one returned by |
|
73 * nsIPluginHost.getPluginTags. |
|
74 * @param domain: the domain to test. If this argument is null, test if data |
|
75 * is stored for any site. The base domain for the given domain |
|
76 * will be determined; if any data for the base domain or its |
|
77 * subdomains is found, return true. |
|
78 */ |
|
79 boolean siteHasData(in nsIPluginTag plugin, in AUTF8String domain); |
|
80 |
|
81 /** |
|
82 * Registers the play preview plugin mode for specific mime type |
|
83 * |
|
84 * @param mimeType: specifies plugin mime type. |
|
85 * @param ignoreCTP: if true, the play preview ignores CTP rules, e.g. |
|
86 whitelisted websites, will not notify about plugin |
|
87 presence in the address bar. |
|
88 * @param redirectURL: specifies url for the overlay iframe |
|
89 */ |
|
90 void registerPlayPreviewMimeType(in AUTF8String mimeType, |
|
91 [optional] in boolean ignoreCTP, |
|
92 [optional] in AUTF8String redirectURL); |
|
93 |
|
94 void unregisterPlayPreviewMimeType(in AUTF8String mimeType); |
|
95 |
|
96 nsIPluginPlayPreviewInfo getPlayPreviewInfo(in AUTF8String mimeType); |
|
97 |
|
98 ACString getPermissionStringForType(in AUTF8String mimeType); |
|
99 |
|
100 /** |
|
101 * Get the nsIPluginTag for this MIME type. This method works with both |
|
102 * enabled and disabled/blocklisted plugins, but an enabled plugin will |
|
103 * always be returned if available. |
|
104 * |
|
105 * @throws NS_ERROR_NOT_AVAILABLE if no plugin is available for this MIME |
|
106 * type. |
|
107 */ |
|
108 nsIPluginTag getPluginTagForType(in AUTF8String mimeType); |
|
109 |
|
110 /** |
|
111 * Get the nsIPluginTag state for this MIME type. |
|
112 */ |
|
113 unsigned long getStateForType(in AUTF8String mimeType); |
|
114 |
|
115 /** |
|
116 * Get the blocklist state for a MIME type. |
|
117 */ |
|
118 uint32_t getBlocklistStateForType(in string aMimeType); |
|
119 }; |
|
120 |