Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Side by Side Diff: ppapi/c/private/ppp_flash_browser_operations.h

Issue 10391173: Pepper Flash settings integration: implement "deauthorize content licenses". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* From private/ppp_flash_browser_operations.idl, 6 /* From private/ppp_flash_browser_operations.idl,
7 * modified Wed Apr 11 16:26:42 2012. 7 * modified Wed May 16 11:20:24 2012.
8 */ 8 */
9 9
10 #ifndef PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ 10 #ifndef PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_
11 #define PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ 11 #define PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_
12 12
13 #include "ppapi/c/pp_bool.h" 13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_stdint.h" 15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
16 17
17 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0 \ 18 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0 \
18 "PPP_Flash_BrowserOperations;1.0" 19 "PPP_Flash_BrowserOperations;1.0"
20 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_1 \
21 "PPP_Flash_BrowserOperations;1.1"
19 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE \ 22 #define PPP_FLASH_BROWSEROPERATIONS_INTERFACE \
20 PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0 23 PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_1
21 24
22 /** 25 /**
23 * @file 26 * @file
24 * This file contains the <code>PPP_Flash_BrowserOperations</code> interface. 27 * This file contains the <code>PPP_Flash_BrowserOperations</code> interface.
25 */ 28 */
26 29
27 30
28 /** 31 /**
32 * @addtogroup Enums
33 * @{
34 */
35 typedef enum {
36 PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_CAMERAMIC = 0,
37 PP_FLASH_BROWSEROPERATIONS_SETTINGTYPE_PEERNETWORKING = 1
38 } PP_Flash_BrowserOperations_SettingType;
39 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_SettingType, 4);
40
41 typedef enum {
42 /* This value is only used with <code>SetSitePermission()</code>. */
43 PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT = 0,
44 PP_FLASH_BROWSEROPERATIONS_PERMISSION_ALLOW = 1,
45 PP_FLASH_BROWSEROPERATIONS_PERMISSION_BLOCK = 2,
46 PP_FLASH_BROWSEROPERATIONS_PERMISSION_ASK = 3
47 } PP_Flash_BrowserOperations_Permission;
48 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_Permission, 4);
49 /**
50 * @}
51 */
52
53 /**
54 * @addtogroup Structs
55 * @{
56 */
57 struct PP_Flash_BrowserOperations_SiteSetting {
58 struct PP_Var site;
59 PP_Flash_BrowserOperations_Permission permission;
60 };
61 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_SiteSetting,
62 24);
63 /**
64 * @}
65 */
66
67 /**
68 * @addtogroup Typedefs
69 * @{
70 */
71 typedef void (*PPB_Flash_BrowserOperations_GetSettingsCallback)(
72 void* user_data,
73 PP_Bool success,
74 PP_Flash_BrowserOperations_Permission default_permission,
75 uint32_t site_count,
76 const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
77 /**
78 * @}
79 */
80
81 /**
29 * @addtogroup Interfaces 82 * @addtogroup Interfaces
30 * @{ 83 * @{
31 */ 84 */
32 /** 85 /**
33 * This interface allows the browser to request the plugin do things. 86 * This interface allows the browser to request the plugin do things.
34 */ 87 */
35 struct PPP_Flash_BrowserOperations_1_0 { 88 struct PPP_Flash_BrowserOperations_1_1 {
36 /** 89 /**
37 * This function allows the plugin to implement the "Clear site data" feature. 90 * This function allows the plugin to implement the "Clear site data" feature.
38 * 91 *
39 * @plugin_data_path String containing the directory where the plugin data is 92 * @plugin_data_path String containing the directory where the plugin data is
40 * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will 93 * stored. On UTF16 systems (Windows), this will be encoded as UTF-8. It will
41 * be an absolute path and will not have a directory separator (slash) at the 94 * be an absolute path and will not have a directory separator (slash) at the
42 * end. 95 * end.
43 * 96 *
44 * @arg site String specifying which site to clear the data for. This will 97 * @arg site String specifying which site to clear the data for. This will
45 * be null to clear data for all sites. 98 * be null to clear data for all sites.
46 * 99 *
47 * @arg flags Currently always 0 in Chrome to clear all data. This may be 100 * @arg flags Currently always 0 in Chrome to clear all data. This may be
48 * extended in the future to clear only specific types of data. 101 * extended in the future to clear only specific types of data.
49 * 102 *
50 * @arg max_age The maximum age in seconds to clear data for. This allows the 103 * @arg max_age The maximum age in seconds to clear data for. This allows the
51 * plugin to implement "clear past hour" and "clear past data", etc. 104 * plugin to implement "clear past hour" and "clear past data", etc.
52 * 105 *
53 * @return PP_TRUE on success, PP_FALSE on failure. 106 * @return PP_TRUE on success, PP_FALSE on failure.
54 * 107 *
55 * See also the NPP_ClearSiteData function in NPAPI. 108 * See also the NPP_ClearSiteData function in NPAPI.
56 * https://wiki.mozilla.org/NPAPI:ClearSiteData 109 * https://wiki.mozilla.org/NPAPI:ClearSiteData
57 */ 110 */
58 PP_Bool (*ClearSiteData)(const char* plugin_data_path, 111 PP_Bool (*ClearSiteData)(const char* plugin_data_path,
59 const char* site, 112 const char* site,
60 uint64_t flags, 113 uint64_t flags,
61 uint64_t max_age); 114 uint64_t max_age);
115 /**
116 * Requests the plugin to deauthorize content licenses. It prevents Flash from
117 * playing protected content, such as movies and music the user may have
118 * rented or purchased.
119 *
120 * @param[in] plugin_data_path String containing the directory where the
121 * plugin settings are stored.
122 *
123 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
124 */
125 PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path);
126 /**
127 * Gets permission settings. <code>callback</code> will be called exactly once
128 * to return the settings.
129 *
130 * @param[in] plugin_data_path String containing the directory where the
131 * plugin settings are stored.
132 * @param[in] setting_type What type of setting to retrieve.
133 * @param[in] callback The callback to return retrieved data.
134 * @param[inout] user_data An opaque pointer that will be passed to
135 * <code>callback</code>.
136 */
137 void (*GetPermissionSettings)(
138 const char* plugin_data_path,
139 PP_Flash_BrowserOperations_SettingType setting_type,
140 PPB_Flash_BrowserOperations_GetSettingsCallback callback,
141 void* user_data);
142 /**
143 * Sets default permission. It applies to all sites except those with
144 * site-specific settings.
145 *
146 * @param[in] plugin_data_path String containing the directory where the
147 * plugin settings are stored.
148 * @param[in] setting_type What type of setting to set.
149 * @param[in] permission The default permission.
150 * @param[in] clear_site_specific Whether to remove all site-specific
151 * settings.
152 *
153 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
154 */
155 PP_Bool (*SetDefaultPermission)(
156 const char* plugin_data_path,
157 PP_Flash_BrowserOperations_SettingType setting_type,
158 PP_Flash_BrowserOperations_Permission permission,
159 PP_Bool clear_site_speicifc);
160 /**
161 * Sets site-specific permission. If a site has already got site-specific
162 * permission and it is not in <code>sites</code>, it won't be affected.
163 *
164 * @param[in] plugin_data_path String containing the directory where the
165 * plugin settings are stored.
166 * @param[in] setting_type What type of setting to set.
167 * @param[in] site_count How many items are there in <code>sites</code>.
168 * @param[in] sites The site-specific settings. If a site is sepcified with
169 * <code>PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT</code> permission, it
170 * will be removed from the site-specific list.
171 *
172 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
173 */
174 PP_Bool (*SetSitePermission)(
175 const char* plugin_data_path,
176 PP_Flash_BrowserOperations_SettingType setting_type,
177 uint32_t site_count,
178 const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
179 };
180
181 typedef struct PPP_Flash_BrowserOperations_1_1 PPP_Flash_BrowserOperations;
182
183 struct PPP_Flash_BrowserOperations_1_0 {
184 PP_Bool (*ClearSiteData)(const char* plugin_data_path,
185 const char* site,
186 uint64_t flags,
187 uint64_t max_age);
62 }; 188 };
63
64 typedef struct PPP_Flash_BrowserOperations_1_0 PPP_Flash_BrowserOperations;
65 /** 189 /**
66 * @} 190 * @}
67 */ 191 */
68 192
69 #endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */ 193 #endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */
70 194
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698