1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
7 * This file contains the <code>PPP_Flash_BrowserOperations</code> interface.
17 enum PP_Flash_BrowserOperations_SettingType
{
18 PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC
= 0,
19 PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING
= 1
23 enum PP_Flash_BrowserOperations_Permission
{
24 // This value is only used with <code>SetSitePermission()</code>.
25 PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT
= 0,
26 PP_FLASH_BROWSEROPERATIONS_PERMISSION_ALLOW
= 1,
27 PP_FLASH_BROWSEROPERATIONS_PERMISSION_BLOCK
= 2,
28 PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK
= 3
31 struct PP_Flash_BrowserOperations_SiteSetting
{
33 PP_Flash_BrowserOperations_Permission permission
;
36 typedef void PPB_Flash_BrowserOperations_GetSettingsCallback
(
37 [inout
] mem_t user_data
,
39 [in] PP_Flash_BrowserOperations_Permission default_permission
,
40 [in] uint32_t site_count
,
41 [in, size_is(site_count
)] PP_Flash_BrowserOperations_SiteSetting
[] sites
);
44 * This interface allows the browser to request the plugin do things.
46 interface PPP_Flash_BrowserOperations
{
48 * This function allows the plugin to implement the "Clear site data" feature.
50 * @param[in] plugin_data_path String containing the directory where the
52 * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will
53 * be an absolute path and will not have a directory separator (slash) at the
55 * @param[in] site String specifying which site to clear the data for. This
56 * will be null to clear data for all sites.
57 * @param[in] flags Currently always 0 in Chrome to clear all data. This may
58 * be extended in the future to clear only specific types of data.
59 * @param[in] max_age The maximum age in seconds to clear data for. This
60 * allows the plugin to implement "clear past hour" and "clear past data",
63 * @return PP_TRUE on success, PP_FALSE on failure.
65 * See also the NPP_ClearSiteData function in NPAPI.
66 * https://wiki.mozilla.org/NPAPI:ClearSiteData
68 PP_Bool ClearSiteData
([in] str_t plugin_data_path
,
71 [in] uint64_t max_age
);
74 * Requests the plugin to deauthorize content licenses. It prevents Flash from
75 * playing protected content, such as movies and music the user may have
76 * rented or purchased.
78 * @param[in] plugin_data_path String containing the directory where the
79 * plugin settings are stored.
81 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
84 PP_Bool DeauthorizeContentLicenses
([in] str_t plugin_data_path
);
87 * Gets permission settings. <code>callback</code> will be called exactly once
88 * to return the settings.
90 * @param[in] plugin_data_path String containing the directory where the
91 * plugin settings are stored.
92 * @param[in] setting_type What type of setting to retrieve.
93 * @param[in] callback The callback to return retrieved data.
94 * @param[inout] user_data An opaque pointer that will be passed to
95 * <code>callback</code>.
98 void GetPermissionSettings
(
99 [in] str_t plugin_data_path
,
100 [in] PP_Flash_BrowserOperations_SettingType setting_type
,
101 [in] PPB_Flash_BrowserOperations_GetSettingsCallback
callback,
102 [inout
] mem_t user_data
);
105 * Sets default permission. It applies to all sites except those with
106 * site-specific settings.
108 * @param[in] plugin_data_path String containing the directory where the
109 * plugin settings are stored.
110 * @param[in] setting_type What type of setting to set.
111 * @param[in] permission The default permission.
112 * @param[in] clear_site_specific Whether to remove all site-specific
115 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
118 PP_Bool SetDefaultPermission
(
119 [in] str_t plugin_data_path
,
120 [in] PP_Flash_BrowserOperations_SettingType setting_type
,
121 [in] PP_Flash_BrowserOperations_Permission permission
,
122 [in] PP_Bool clear_site_specific
);
125 * Sets site-specific permission. If a site has already got site-specific
126 * permission and it is not in <code>sites</code>, it won't be affected.
128 * @param[in] plugin_data_path String containing the directory where the
129 * plugin settings are stored.
130 * @param[in] setting_type What type of setting to set.
131 * @param[in] site_count How many items are there in <code>sites</code>.
132 * @param[in] sites The site-specific settings. If a site is specified with
133 * <code>PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT</code> permission, it
134 * will be removed from the site-specific list.
136 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
139 PP_Bool SetSitePermission
(
140 [in] str_t plugin_data_path
,
141 [in] PP_Flash_BrowserOperations_SettingType setting_type
,
142 [in] uint32_t site_count
,
143 [in, size_is(site_count
)] PP_Flash_BrowserOperations_SiteSetting
[] sites
);
146 * Returns a list of sites that have stored data, for use with the
147 * "Clear site data" feature.
149 * @param[in] plugin_data_path String containing the directory where the
150 * plugin data is stored.
151 * @param[out] sites A NULL-terminated array of sites that have stored data.
152 * Use FreeSiteList on the array when done.
154 * See also the NPP_GetSitesWithData function in NPAPI:
155 * https://wiki.mozilla.org/NPAPI:ClearSiteData
158 void GetSitesWithData
([in] str_t plugin_data_path
,
159 [out] str_t
[] sites
);
162 * Frees the list of sites returned by GetSitesWithData.
164 * @param[in] sites A NULL-terminated array of strings.
167 void FreeSiteList
([inout
] str_t
[] sites
);