@@ -177,6 +177,7 @@ enum {
177177 PROP_ALLOW_RUNNING_OF_INSECURE_CONTENT,
178178 PROP_ALLOW_DISPLAY_OF_INSECURE_CONTENT,
179179 PROP_ALLOW_SCRIPTS_TO_CLOSE_WINDOWS,
180+ PROP_ALLOW_MOVE_TO_SUSPEND_ON_WINDOW_CLOSE,
180181 PROP_ENABLE_DIRECTORY_UPLOAD,
181182 N_PROPERTIES,
182183};
@@ -423,6 +424,9 @@ ALLOW_DEPRECATED_DECLARATIONS_END
423424 case PROP_ALLOW_SCRIPTS_TO_CLOSE_WINDOWS:
424425 webkit_settings_set_allow_scripts_to_close_windows (settings, g_value_get_boolean (value));
425426 break ;
427+ case PROP_ALLOW_MOVE_TO_SUSPEND_ON_WINDOW_CLOSE:
428+ webkit_settings_set_allow_move_to_suspend_on_window_close (settings, g_value_get_boolean (value));
429+ break ;
426430 case PROP_ENABLE_DIRECTORY_UPLOAD:
427431 webkit_settings_set_enable_directory_upload (settings, g_value_get_boolean (value));
428432 break ;
@@ -642,6 +646,9 @@ ALLOW_DEPRECATED_DECLARATIONS_END
642646 case PROP_ALLOW_SCRIPTS_TO_CLOSE_WINDOWS:
643647 g_value_set_boolean (value, webkit_settings_get_allow_scripts_to_close_windows (settings));
644648 break ;
649+ case PROP_ALLOW_MOVE_TO_SUSPEND_ON_WINDOW_CLOSE:
650+ g_value_set_boolean (value, webkit_settings_get_allow_move_to_suspend_on_window_close (settings));
651+ break ;
645652 case PROP_ENABLE_DIRECTORY_UPLOAD:
646653 g_value_set_boolean (value, webkit_settings_get_enable_directory_upload (settings));
647654 break ;
@@ -1699,6 +1706,19 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
16991706 FALSE ,
17001707 readWriteConstructParamFlags);
17011708
1709+ /* *
1710+ * WebKitSettings:allow-move-to-suspend-on-window-close:
1711+ *
1712+ * Allow browser to move to suspend on window close.
1713+ *
1714+ */
1715+ sObjProperties [PROP_ALLOW_MOVE_TO_SUSPEND_ON_WINDOW_CLOSE] = g_param_spec_boolean (
1716+ " allow-scripts-to-close-windows" ,
1717+ _ (" Allow move to suspend on window.close()" ),
1718+ _ (" Allow to suspend browser instead of closing window on window.close()" ),
1719+ FALSE ,
1720+ readWriteConstructParamFlags);
1721+
17021722 /* *
17031723 * WebKitSettings:enable-directory-upload:
17041724 *
@@ -4260,6 +4280,42 @@ webkit_settings_set_allow_scripts_to_close_windows(WebKitSettings *settings, gbo
42604280 g_object_notify (G_OBJECT (settings), " allow-scripts-to-close-windows" );
42614281}
42624282
4283+ /* *
4284+ * webkit_settings_get_allow_move_to_suspend_on_window_close:
4285+ * @settings: a #WebKitSettings
4286+ *
4287+ * Get the #WebKitSettings:allow-move-to-suspend-on-window-close property.
4288+ *
4289+ * Returns: %TRUE If browser can be suspended on window close.
4290+ */
4291+ gboolean webkit_settings_get_allow_move_to_suspend_on_window_close (WebKitSettings *settings)
4292+ {
4293+ g_return_val_if_fail (WEBKIT_IS_SETTINGS (settings), FALSE );
4294+
4295+ return settings->priv ->preferences ->allowMoveToSuspendOnWindowClose ();
4296+ }
4297+
4298+ /* *
4299+ * webkit_settings_set_allow_move_to_suspend_on_window_close
4300+ * @settings: a #WebKitSettings
4301+ * @allowed: Value to be set
4302+ *
4303+ * Set the #WebKitSettings:allow-move-to-suspend-on-window-close property.
4304+ */
4305+ WEBKIT_API void
4306+ webkit_settings_set_allow_move_to_suspend_on_window_close (WebKitSettings *settings, gboolean allowed)
4307+ {
4308+ g_return_if_fail (WEBKIT_IS_SETTINGS (settings));
4309+
4310+ WebKitSettingsPrivate* priv = settings->priv ;
4311+ bool currentValue = priv->preferences ->allowMoveToSuspendOnWindowClose ();
4312+ if (currentValue == allowed)
4313+ return ;
4314+
4315+ priv->preferences ->setAllowMoveToSuspendOnWindowClose (allowed);
4316+ g_object_notify (G_OBJECT (settings), " allow-move-to-suspend-on-window-close" );
4317+ }
4318+
42634319/* *
42644320 * webkit_settings_get_enable_directory_upload:
42654321 * @settings: a #WebKitSettings
0 commit comments