OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This header specifies the Chrome Plugin API. It is based heavily on NPAPI. | 5 // This header specifies the Chrome Plugin API. It is based heavily on NPAPI. |
6 // The key difference is that Chrome plugins can be loaded for the lifetime | 6 // The key difference is that Chrome plugins can be loaded for the lifetime |
7 // of the browser, and are not tied to a specific web page. | 7 // of the browser, and are not tied to a specific web page. |
8 // | 8 // |
9 // NOTE: This API is not final and may change or go away at any point. | 9 // NOTE: This API is not final and may change or go away at any point. |
10 // | 10 // |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // If keep_alive is non-zero, the process will not be terminated when | 211 // If keep_alive is non-zero, the process will not be terminated when |
212 // the instance count goes to zero. Note: a non-zero keep_alive value | 212 // the instance count goes to zero. Note: a non-zero keep_alive value |
213 // does not prevent the plugin process from being terminated upon | 213 // does not prevent the plugin process from being terminated upon |
214 // overall browser shutdown. | 214 // overall browser shutdown. |
215 typedef void (STDCALL *CPB_SetKeepProcessAliveFunc)(CPID id, | 215 typedef void (STDCALL *CPB_SetKeepProcessAliveFunc)(CPID id, |
216 CPBool keep_alive); | 216 CPBool keep_alive); |
217 | 217 |
218 // Asks the browser to show an HTML dialog to the user. The dialog contents | 218 // Asks the browser to show an HTML dialog to the user. The dialog contents |
219 // should be loaded from the given URL. The 'json_arguments' is a JSON string | 219 // should be loaded from the given URL. The 'json_arguments' is a JSON string |
220 // that the dialog can fetch using Chrome's JavaScript DOM bindings. This call | 220 // that the dialog can fetch using Chrome's JavaScript DOM bindings. This call |
221 // will block until the dialog is closed. On success, 'json_retval' will contai
n | 221 // will block until the dialog is closed. On success, 'json_retval' will |
222 // the JSON string sent back by the dialog (using Chrome's JavaScript DOM | 222 // contain the JSON string sent back by the dialog (using Chrome's JavaScript |
223 // bindings), and CPERR_SUCCESS is returned. 'json_retval' should be freed | 223 // DOM bindings), and CPERR_SUCCESS is returned. 'json_retval' should be freed |
224 // using CPB_Free when done. | 224 // using CPB_Free when done. |
225 typedef CPError (STDCALL *CPB_ShowHtmlDialogModalFunc)( | 225 typedef CPError (STDCALL *CPB_ShowHtmlDialogModalFunc)( |
226 CPID id, CPBrowsingContext context, const char* url, int width, int height, | 226 CPID id, CPBrowsingContext context, const char* url, int width, int height, |
227 const char* json_arguments, char** json_retval); | 227 const char* json_arguments, char** json_retval); |
228 | 228 |
229 // Similar to CPB_ShowHtmlDialogModalFunc, but does not block. When the dialog | 229 // Similar to CPB_ShowHtmlDialogModalFunc, but does not block. When the dialog |
230 // is closed, CPP_HtmlDialogClosed is called with the JSON return value and the | 230 // is closed, CPP_HtmlDialogClosed is called with the JSON return value and the |
231 // given 'plugin_context', which may be used by the plugin to associate other | 231 // given 'plugin_context', which may be used by the plugin to associate other |
232 // data with the dialog. | 232 // data with the dialog. |
233 typedef CPError (STDCALL *CPB_ShowHtmlDialogFunc)( | 233 typedef CPError (STDCALL *CPB_ShowHtmlDialogFunc)( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 bool multiple_files, | 398 bool multiple_files, |
399 const char *title, | 399 const char *title, |
400 const char *filter, | 400 const char *filter, |
401 void *user_data); | 401 void *user_data); |
402 | 402 |
403 // Informs the plugin of raw data having been sent from another process. | 403 // Informs the plugin of raw data having been sent from another process. |
404 typedef void (STDCALL *CPP_OnMessageFunc)(void *data, uint32 data_len); | 404 typedef void (STDCALL *CPP_OnMessageFunc)(void *data, uint32 data_len); |
405 | 405 |
406 // Informs the plugin of raw data having been sent from another process. | 406 // Informs the plugin of raw data having been sent from another process. |
407 typedef void (STDCALL *CPP_OnSyncMessageFunc)(void *data, uint32 data_len, | 407 typedef void (STDCALL *CPP_OnSyncMessageFunc)(void *data, uint32 data_len, |
408 void **retval, uint32 *retval_len)
; | 408 void **retval, |
| 409 uint32 *retval_len); |
409 | 410 |
410 // Informs the plugin that the file dialog has completed, and contains the | 411 // Informs the plugin that the file dialog has completed, and contains the |
411 // results. | 412 // results. |
412 typedef void (STDCALL *CPP_OnFileDialogResultFunc)(void *data, | 413 typedef void (STDCALL *CPP_OnFileDialogResultFunc)(void *data, |
413 const char **files, | 414 const char **files, |
414 uint32 files_len); | 415 uint32 files_len); |
415 | 416 |
416 // Function table for issuing requests using via the other side's network stack. | 417 // Function table for issuing requests using via the other side's network stack. |
417 // For the plugin, this functions deal with issuing requests through the | 418 // For the plugin, this functions deal with issuing requests through the |
418 // browser. For the browser, these functions deal with allowing the plugin to | 419 // browser. For the browser, these functions deal with allowing the plugin to |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 // than the one CP_InitializeFunc is called from. | 517 // than the one CP_InitializeFunc is called from. |
517 typedef CPError (STDCALL *CP_InitializeFunc)( | 518 typedef CPError (STDCALL *CP_InitializeFunc)( |
518 CPID id, const CPBrowserFuncs* bfuncs, CPPluginFuncs* pfuncs); | 519 CPID id, const CPBrowserFuncs* bfuncs, CPPluginFuncs* pfuncs); |
519 | 520 |
520 #ifdef __cplusplus | 521 #ifdef __cplusplus |
521 } // extern "C" | 522 } // extern "C" |
522 #endif | 523 #endif |
523 | 524 |
524 #endif // CHROME_COMMON_CHROME_PLUGIN_API_H__ | 525 #endif // CHROME_COMMON_CHROME_PLUGIN_API_H__ |
525 | 526 |
OLD | NEW |