mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add a new CefLifeSpanHandler::CanCreatePopup() method for canceling the creation of popup windows (issue #816).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1085 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -47,7 +47,8 @@ extern "C" {
|
||||
|
||||
///
|
||||
// Implement this structure to handle events related to browser life span. The
|
||||
// functions of this structure will be called on the UI thread.
|
||||
// functions of this structure will be called on the UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_life_span_handler_t {
|
||||
///
|
||||
@@ -56,21 +57,39 @@ typedef struct _cef_life_span_handler_t {
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Called before a new popup window is created. The |parentBrowser| parameter
|
||||
// will point to the parent browser window. The |popupFeatures| parameter will
|
||||
// contain information about the style of popup window requested. Return false
|
||||
// (0) to have the framework create the new popup window based on the
|
||||
// parameters in |windowInfo|. Return true (1) to cancel creation of the popup
|
||||
// window. By default, a newly created popup window will have the same client
|
||||
// and settings as the parent window. To change the client for the new window
|
||||
// modify the object that |client| points to. To change the settings for the
|
||||
// new window modify the |settings| structure.
|
||||
// Called on the IO thread before a new popup window is created. The |browser|
|
||||
// and |frame| parameters represent the source of the popup request. The
|
||||
// |target_url| and |target_frame_name| values may be NULL if none was
|
||||
// specified with the request. Return true (1) to allow creation of the popup
|
||||
// window or false (0) to cancel creation. If true (1) is returned,
|
||||
// |no_javascript_access| will indicate whether the window that is created
|
||||
// should be scriptable/in the same process as the source browser. Do not
|
||||
// perform blocking work in this callback as it will block the associated
|
||||
// render process. To completely disable popup windows for a browser set
|
||||
// cef_browser_tSettings.javascript_open_windows to STATE_DISABLED.
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* parentBrowser,
|
||||
int (CEF_CALLBACK *can_create_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
const cef_string_t* target_url, const cef_string_t* target_frame_name,
|
||||
int* no_javascript_access);
|
||||
|
||||
///
|
||||
// Called before the cef_browser_host_t object associated with a new popup
|
||||
// window is created. This function will only be called in can_create_popup()
|
||||
// returns true (1). The |browser| parameter represents the source of the
|
||||
// popup request. The |popupFeatures| parameter will contain information about
|
||||
// the style of popup window requested. The framework will create the new
|
||||
// popup window based on the parameters in |windowInfo|. By default, a newly
|
||||
// created popup window will have the same client and settings as the parent
|
||||
// window. To change the client for the new window modify the object that
|
||||
// |client| points to. To change the settings for the new window modify the
|
||||
// |settings| structure.
|
||||
///
|
||||
void (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const struct _cef_popup_features_t* popupFeatures,
|
||||
struct _cef_window_info_t* windowInfo, const cef_string_t* url,
|
||||
struct _cef_client_t** client,
|
||||
struct _cef_window_info_t* windowInfo, const cef_string_t* target_url,
|
||||
const cef_string_t* target_frame_name, struct _cef_client_t** client,
|
||||
struct _cef_browser_settings_t* settings);
|
||||
|
||||
///
|
||||
|
Reference in New Issue
Block a user