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

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: rebase 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
« no previous file with comments | « ppapi/api/private/ppp_flash_browser_operations.idl ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Thu May 24 15:41:01 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 /* Makes the size consistent across compilers. */
61 int32_t padding;
62 };
63 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Flash_BrowserOperations_SiteSetting, 2 4);
64 /**
65 * @}
66 */
67
68 /**
69 * @addtogroup Typedefs
70 * @{
71 */
72 typedef void (*PPB_Flash_BrowserOperations_GetSettingsCallback)(
73 void* user_data,
74 PP_Bool success,
75 PP_Flash_BrowserOperations_Permission default_permission,
76 uint32_t site_count,
77 const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
78 /**
79 * @}
80 */
81
82 /**
29 * @addtogroup Interfaces 83 * @addtogroup Interfaces
30 * @{ 84 * @{
31 */ 85 */
32 /** 86 /**
33 * This interface allows the browser to request the plugin do things. 87 * This interface allows the browser to request the plugin do things.
34 */ 88 */
35 struct PPP_Flash_BrowserOperations_1_0 { 89 struct PPP_Flash_BrowserOperations_1_1 {
36 /** 90 /**
37 * This function allows the plugin to implement the "Clear site data" feature. 91 * This function allows the plugin to implement the "Clear site data" feature.
38 * 92 *
39 * @plugin_data_path String containing the directory where the plugin data is 93 * @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 94 * 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 95 * be an absolute path and will not have a directory separator (slash) at the
42 * end. 96 * end.
43 * 97 *
44 * @arg site String specifying which site to clear the data for. This will 98 * @arg site String specifying which site to clear the data for. This will
45 * be null to clear data for all sites. 99 * be null to clear data for all sites.
46 * 100 *
47 * @arg flags Currently always 0 in Chrome to clear all data. This may be 101 * @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. 102 * extended in the future to clear only specific types of data.
49 * 103 *
50 * @arg max_age The maximum age in seconds to clear data for. This allows the 104 * @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. 105 * plugin to implement "clear past hour" and "clear past data", etc.
52 * 106 *
53 * @return PP_TRUE on success, PP_FALSE on failure. 107 * @return PP_TRUE on success, PP_FALSE on failure.
54 * 108 *
55 * See also the NPP_ClearSiteData function in NPAPI. 109 * See also the NPP_ClearSiteData function in NPAPI.
56 * https://wiki.mozilla.org/NPAPI:ClearSiteData 110 * https://wiki.mozilla.org/NPAPI:ClearSiteData
57 */ 111 */
58 PP_Bool (*ClearSiteData)(const char* plugin_data_path, 112 PP_Bool (*ClearSiteData)(const char* plugin_data_path,
59 const char* site, 113 const char* site,
60 uint64_t flags, 114 uint64_t flags,
61 uint64_t max_age); 115 uint64_t max_age);
116 /**
117 * Requests the plugin to deauthorize content licenses. It prevents Flash from
118 * playing protected content, such as movies and music the user may have
119 * rented or purchased.
120 *
121 * @param[in] plugin_data_path String containing the directory where the
122 * plugin settings are stored.
123 *
124 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
125 */
126 PP_Bool (*DeauthorizeContentLicenses)(const char* plugin_data_path);
127 /**
128 * Gets permission settings. <code>callback</code> will be called exactly once
129 * to return the settings.
130 *
131 * @param[in] plugin_data_path String containing the directory where the
132 * plugin settings are stored.
133 * @param[in] setting_type What type of setting to retrieve.
134 * @param[in] callback The callback to return retrieved data.
135 * @param[inout] user_data An opaque pointer that will be passed to
136 * <code>callback</code>.
137 */
138 void (*GetPermissionSettings)(
139 const char* plugin_data_path,
140 PP_Flash_BrowserOperations_SettingType setting_type,
141 PPB_Flash_BrowserOperations_GetSettingsCallback callback,
142 void* user_data);
143 /**
144 * Sets default permission. It applies to all sites except those with
145 * site-specific settings.
146 *
147 * @param[in] plugin_data_path String containing the directory where the
148 * plugin settings are stored.
149 * @param[in] setting_type What type of setting to set.
150 * @param[in] permission The default permission.
151 * @param[in] clear_site_specific Whether to remove all site-specific
152 * settings.
153 *
154 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
155 */
156 PP_Bool (*SetDefaultPermission)(
157 const char* plugin_data_path,
158 PP_Flash_BrowserOperations_SettingType setting_type,
159 PP_Flash_BrowserOperations_Permission permission,
160 PP_Bool clear_site_speicifc);
161 /**
162 * Sets site-specific permission. If a site has already got site-specific
163 * permission and it is not in <code>sites</code>, it won't be affected.
164 *
165 * @param[in] plugin_data_path String containing the directory where the
166 * plugin settings are stored.
167 * @param[in] setting_type What type of setting to set.
168 * @param[in] site_count How many items are there in <code>sites</code>.
169 * @param[in] sites The site-specific settings. If a site is specified with
170 * <code>PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT</code> permission, it
171 * will be removed from the site-specific list.
172 *
173 * @return <code>PP_TRUE</code> on success, <code>PP_FALSE</code> on failure.
174 */
175 PP_Bool (*SetSitePermission)(
176 const char* plugin_data_path,
177 PP_Flash_BrowserOperations_SettingType setting_type,
178 uint32_t site_count,
179 const struct PP_Flash_BrowserOperations_SiteSetting sites[]);
180 };
181
182 typedef struct PPP_Flash_BrowserOperations_1_1 PPP_Flash_BrowserOperations;
183
184 struct PPP_Flash_BrowserOperations_1_0 {
185 PP_Bool (*ClearSiteData)(const char* plugin_data_path,
186 const char* site,
187 uint64_t flags,
188 uint64_t max_age);
62 }; 189 };
63
64 typedef struct PPP_Flash_BrowserOperations_1_0 PPP_Flash_BrowserOperations;
65 /** 190 /**
66 * @} 191 * @}
67 */ 192 */
68 193
69 #endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */ 194 #endif /* PPAPI_C_PRIVATE_PPP_FLASH_BROWSER_OPERATIONS_H_ */
70 195
OLDNEW
« no previous file with comments | « ppapi/api/private/ppp_flash_browser_operations.idl ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698