Pepper_47_C_interfaces
ppp_flash_browser_operations.h
Go to the documentation of this file.
1 /* Copyright 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.
4  */
5 
6 /* From private/ppp_flash_browser_operations.idl,
7  * modified Thu Oct 20 13:57:04 2016.
8  */
9 
10 #ifndef PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_
11 #define PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_
12 
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_stdint.h"
16 
17 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0 \
18  "PPP_Flash_BrowserOperations;1.0"
19 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_2 \
20  "PPP_Flash_BrowserOperations;1.2"
21 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3 \
22  "PPP_Flash_BrowserOperations;1.3"
23 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE \
24  PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3
25 
26 /**
27  * @file
28  * This file contains the <code>PPP_Flash_BrowserOperations</code> interface.
29  */
30 
31 
32 /**
33  * @addtogroup Enums
34  * @{
35  */
36 typedef enum {
41 
42 typedef enum {
43  /* This value is only used with <code>SetSitePermission()</code>. */
50 /**
51  * @}
52  */
53 
54 /**
55  * @addtogroup Structs
56  * @{
57  */
59  const char* site;
61 };
62 /**
63  * @}
64  */
65 
66 /**
67  * @addtogroup Typedefs
68  * @{
69  */
71  void* user_data,
72  PP_Bool success,
73  PP_Flash_BrowserOperations_Permission default_permission,
74  uint32_t site_count,
75  const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
76 /**
77  * @}
78  */
79 
80 /**
81  * @addtogroup Interfaces
82  * @{
83  */
84 /**
85  * This interface allows the browser to request the plugin do things.
86  */
88  /**
89  * This function allows the plugin to implement the "Clear site data" feature.
90  *
91  * @param[in] plugin_data_path String containing the directory where the
92  * plugin data is
93  * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will
94  * be an absolute path and will not have a directory separator (slash) at the
95  * end.
96  * @param[in] site String specifying which site to clear the data for. This
97  * will be null to clear data for all sites.
98  * @param[in] flags Currently always 0 in Chrome to clear all data. This may
99  * be extended in the future to clear only specific types of data.
100  * @param[in] max_age The maximum age in seconds to clear data for. This
101  * allows the plugin to implement "clear past hour" and "clear past data",
102  * etc.
103  *
104  * @return PP_TRUE on success, PP_FALSE on failure.
105  *
106  * See also the NPP_ClearSiteData function in NPAPI.
107  * https://wiki.mozilla.org/NPAPI:ClearSiteData
108  */
109  PP_Bool (*ClearSiteData)(const char* plugin_data_path,
110  const char* site,
111  uint64_t flags,
112  uint64_t max_age);
113  /**
114  * Requests the plugin to deauthorize content licenses. It prevents Flash from
115  * playing protected content, such as movies and music the user may have
116  * rented or purchased.
117  *
118  * @param[in] plugin_data_path String containing the directory where the
119  * plugin settings are stored.
120  *
121  * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
122  */
123  PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path);
124  /**
125  * Gets permission settings. <code>callback</code> will be called exactly once
126  * to return the settings.
127  *
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 retrieve.
131  * @param[in] callback The callback to return retrieved data.
132  * @param[inout] user_data An opaque pointer that will be passed to
133  * <code>callback</code>.
134  */
136  const char* plugin_data_path,
139  void* user_data);
140  /**
141  * Sets default permission. It applies to all sites except those with
142  * site-specific settings.
143  *
144  * @param[in] plugin_data_path String containing the directory where the
145  * plugin settings are stored.
146  * @param[in] setting_type What type of setting to set.
147  * @param[in] permission The default permission.
148  * @param[in] clear_site_specific Whether to remove all site-specific
149  * settings.
150  *
151  * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
152  */
154  const char* plugin_data_path,
157  PP_Bool clear_site_specific);
158  /**
159  * Sets site-specific permission. If a site has already got site-specific
160  * permission and it is not in <code>sites</code>, it won't be affected.
161  *
162  * @param[in] plugin_data_path String containing the directory where the
163  * plugin settings are stored.
164  * @param[in] setting_type What type of setting to set.
165  * @param[in] site_count How many items are there in <code>sites</code>.
166  * @param[in] sites The site-specific settings. If a site is specified with
167  * <code>PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT</code> permission, it
168  * will be removed from the site-specific list.
169  *
170  * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
171  */
173  const char* plugin_data_path,
175  uint32_t site_count,
176  const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
177  /**
178  * Returns a list of sites that have stored data, for use with the
179  * "Clear site data" feature.
180  *
181  * @param[in] plugin_data_path String containing the directory where the
182  * plugin data is stored.
183  * @param[out] sites A NULL-terminated array of sites that have stored data.
184  * Use FreeSiteList on the array when done.
185  *
186  * See also the NPP_GetSitesWithData function in NPAPI:
187  * https://wiki.mozilla.org/NPAPI:ClearSiteData
188  */
189  void (*GetSitesWithData)(const char* plugin_data_path, char*** sites);
190  /**
191  * Frees the list of sites returned by GetSitesWithData.
192  *
193  * @param[in] sites A NULL-terminated array of strings.
194  */
195  void (*FreeSiteList)(char* sites[]);
196 };
197 
199 
201  PP_Bool (*ClearSiteData)(const char* plugin_data_path,
202  const char* site,
203  uint64_t flags,
204  uint64_t max_age);
205 };
206 
208  PP_Bool (*ClearSiteData)(const char* plugin_data_path,
209  const char* site,
210  uint64_t flags,
211  uint64_t max_age);
212  PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path);
214  const char* plugin_data_path,
217  void* user_data);
219  const char* plugin_data_path,
222  PP_Bool clear_site_specific);
224  const char* plugin_data_path,
226  uint32_t site_count,
227  const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
228 };
229 /**
230  * @}
231  */
232 
233 #endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */
234 
void(* GetSitesWithData)(const char *plugin_data_path, char ***sites)
PP_Bool(* SetSitePermission)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, uint32_t site_count, const struct PP_Flash_BrowserOperations_SiteSetting sites[])
void(* GetPermissionSettings)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, PPB_Flash_BrowserOperations_GetSettingsCallback callback, void *user_data)
PP_Bool(* ClearSiteData)(const char *plugin_data_path, const char *site, uint64_t flags, uint64_t max_age)
PP_Bool(* ClearSiteData)(const char *plugin_data_path, const char *site, uint64_t flags, uint64_t max_age)
PP_Flash_BrowserOperations_Permission permission
void(* PPB_Flash_BrowserOperations_GetSettingsCallback)(void *user_data, PP_Bool success, PP_Flash_BrowserOperations_Permission default_permission, uint32_t site_count, const struct PP_Flash_BrowserOperations_SiteSetting sites[])
PP_Bool(* ClearSiteData)(const char *plugin_data_path, const char *site, uint64_t flags, uint64_t max_age)
PP_Bool(* DeauthorizeContentLicenses)(const char *plugin_data_path)
PP_Bool(* SetDefaultPermission)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, PP_Flash_BrowserOperations_Permission permission, PP_Bool clear_site_specific)
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_SettingType, 4)
void(* GetPermissionSettings)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, PPB_Flash_BrowserOperations_GetSettingsCallback callback, void *user_data)
PP_Bool(* SetDefaultPermission)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, PP_Flash_BrowserOperations_Permission permission, PP_Bool clear_site_specific)
PP_Flash_BrowserOperations_Permission
PP_Bool(* DeauthorizeContentLicenses)(const char *plugin_data_path)
PP_Bool
Definition: pp_bool.h:30
PP_Bool(* SetSitePermission)(const char *plugin_data_path, PP_Flash_BrowserOperations_SettingType setting_type, uint32_t site_count, const struct PP_Flash_BrowserOperations_SiteSetting sites[])
PP_Flash_BrowserOperations_SettingType