cef/include
Marshall Greenblatt 0b99f92e97 views: Add support for modal browser dialogs
A modal dialog is a child CefWindow that implements some special behaviors
relative to a parent CefWindow. Like any CefWindow it can be framed with
titlebar or frameless, and optionally contain draggable regions (subject to
platform limitations described below). Modal dialogs are shown centered on
the parent window (inside a single display) and always stay on top of the
parent window in z-order. Sizing behavior and available window buttons are
controlled via the usual CefWindowDelegate callbacks. For example, the dialog
can have a preferred size with resize, minimize and maximize disabled (via
GetPreferredSize, CanResize, CanMinimize and CanMaximize respectively).

This change adds support for two modality modes. With window modality all
controls in the parent window are disabled. With browser modality only the
browser view in the parent window is disabled.

Both modality modes require that a valid parent window be returned via
GetParentWindow. For window modality return true from IsWindowModalDialog
and call CefWindow::Show. For browser modality return false from
IsWindowModalDialog (the default value) and call
CefWindow::ShowAsBrowserModalDialog with a reference to the parent window's
browser view.

Window modal dialog behavior depends on the platform. On Windows and
Linux these dialogs have a titlebar and can be moved independent of the
parent window. On macOS these dialogs do not have a titlebar, move with
the parent window, and do not support draggable regions (because they are
implemented using sheets). On Linux disabling the parent window controls
requires a window manager the supports _NET_WM_STATE_MODAL.

Browser modal dialog behavior is similar on all platforms. The dialog will
be automatically sized and positioned relative to the parent window's
browser view. Closing the parent window or navigating the parent browser
view will dismiss the dialog. The dialog can also be moved independent of
the parent window though it will be recentered when the parent window
itself is resized or redisplayed. On MacOS the dialog will move along with
the parent window while on Windows and Linux the parent window can be moved
independently.

To test: Use the Tests > Dialog Window menu option in cefclient with Views
enabled (`--use-views` or `--enable-chrome-runtime` command-line flag).
Browser modal dialog is the default behavior. For window modal dialog add
the `--use-window-modal-dialog` command-line flag.
2023-06-21 11:18:24 +03:00
..
base Delete cef_basictypes.h which is no longer required (fixes #3507) 2023-06-01 19:32:36 +03:00
capi views: Add support for modal browser dialogs 2023-06-21 11:18:24 +03:00
internal mac: Fix char16_t declaration error with Xcode 14.2 (fixes #3526) 2023-06-07 13:25:23 +03:00
test Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
views views: Add support for modal browser dialogs 2023-06-21 11:18:24 +03:00
wrapper Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_accessibility_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_api_hash.h views: Add support for modal browser dialogs 2023-06-21 11:18:24 +03:00
cef_app.h windows: Configure stack size for executables (fixes issue #3250) 2022-10-21 14:52:50 -04:00
cef_application_mac.h Update to Chromium version 114.0.5735.0 (#1135570) 2023-05-05 22:53:16 +03:00
cef_audio_handler.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_auth_callback.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_base.h Update include files for bracket style 2023-01-04 21:36:29 -05:00
cef_browser.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_browser_process_handler.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_callback.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_client.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_command_handler.h chrome: Add ability to hide toolbar and app menu contents (see issue #3280) 2023-03-08 12:02:49 -05:00
cef_command_line.h Fix the comments to CefCommandLine::AppendSwitch methods 2023-01-12 11:51:25 -05:00
cef_context_menu_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_cookie.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_crash_util.h alloy: Remove CefSettings.user_data_path (fixes #3511) 2023-06-06 17:41:57 +03:00
cef_devtools_message_observer.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_dialog_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_display_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_dom.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_download_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_download_item.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_drag_data.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_drag_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_extension.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_extension_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_file_util.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_find_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_focus_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_frame.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_frame_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_i18n_util.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_image.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_jsdialog_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_keyboard_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_life_span_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_load_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_media_router.h Update to Chromium version 111.0.5563.0 (#1097615) 2023-02-03 13:00:26 -05:00
cef_menu_model.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_menu_model_delegate.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_navigation_entry.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_origin_whitelist.h Fix typos in cef_origin_whitelist.h and capi/cef_origin_whitelist_capi.h 2023-04-12 18:21:39 +00:00
cef_parser.h Add CefResolveURL function (fixes issue #3402) 2022-10-03 17:46:50 +00:00
cef_path_util.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_permission_handler.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_preference.h Support registration of custom preferences. 2022-10-26 16:54:33 -04:00
cef_print_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_print_settings.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_process_message.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_process_util.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_registration.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_render_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_render_process_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_request.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_request_context.h Add methods for configuring website/content settings (fixes #3490) 2023-05-25 11:15:06 +00:00
cef_request_context_handler.h Support registration of custom preferences. 2022-10-26 16:54:33 -04:00
cef_request_handler.h Update to Chromium version 109.0.5414.0 (#1070088) 2022-11-17 12:50:15 -05:00
cef_resource_bundle.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_resource_bundle_handler.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_resource_handler.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_resource_request_handler.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_response.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_response_filter.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_sandbox_mac.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_sandbox_win.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_scheme.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_server.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_shared_memory_region.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_shared_process_message_builder.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_ssl_info.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_ssl_status.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_stream.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_string_visitor.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_task.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_thread.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_trace.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_urlrequest.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_v8.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_values.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_waitable_event.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00
cef_x509_certificate.h Update to Chromium version 115.0.5790.0 (#1148114) 2023-06-01 13:44:39 +03:00
cef_xml_reader.h Update include/ comments to Doxygen formatting (see issue #3384) 2022-09-01 17:14:30 -04:00
cef_zip_reader.h Remove CEF-specific integer and char16 typedef's (see #3507) 2023-06-01 19:32:36 +03:00