cef/include/capi
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
..
test Update generated files for int/char typedef removal (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
cef_accessibility_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_app_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_audio_handler_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_auth_callback_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_base_capi.h
cef_browser_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_browser_process_handler_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_callback_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_client_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_command_handler_capi.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_capi.h Fix the comments to CefCommandLine::AppendSwitch methods 2023-01-12 11:51:25 -05:00
cef_context_menu_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_cookie_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_crash_util_capi.h alloy: Remove CefSettings.user_data_path (fixes #3511) 2023-06-06 17:41:57 +03:00
cef_devtools_message_observer_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_dialog_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_display_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_dom_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_download_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_download_item_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_drag_data_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_drag_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_extension_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_extension_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_file_util_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_find_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_focus_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_frame_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_frame_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_i18n_util_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_image_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_jsdialog_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_keyboard_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_life_span_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_load_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_media_access_handler_capi.h Add CefPermissionHandler callback for media access (fixes issue #2582) 2022-06-30 07:31:18 +00:00
cef_media_router_capi.h Update to Chromium version 111.0.5563.0 (#1097615) 2023-02-03 13:00:26 -05:00
cef_menu_model_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_menu_model_delegate_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_navigation_entry_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_origin_whitelist_capi.h Replace NOTREACHED() with DCHECK(false) in generated files (see #3500) 2023-05-08 18:36:00 +03:00
cef_parser_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_path_util_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_permission_handler_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_preference_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_preference_manager_capi.h Support registration of custom preferences. 2022-10-26 16:54:33 -04:00
cef_print_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_print_settings_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_process_message_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_process_util_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_registration_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_render_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_render_process_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_request_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_request_context_capi.h Add methods for configuring website/content settings (fixes #3490) 2023-05-25 11:15:06 +00:00
cef_request_context_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_request_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_resource_bundle_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_resource_bundle_handler_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_resource_handler_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_resource_request_handler_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_response_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_response_filter_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_scheme_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_server_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_shared_memory_region_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_shared_process_message_builder_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_ssl_info_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_ssl_status_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_stream_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_string_visitor_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_task_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_thread_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_trace_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_urlrequest_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_v8_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_values_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_waitable_event_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00
cef_x509_certificate_capi.h Update to Chromium version 115.0.5790.0 (#1148114) 2023-06-01 13:44:39 +03:00
cef_xml_reader_capi.h Update generated files for copyright year and bracket style 2023-01-04 17:47:12 -05:00
cef_zip_reader_capi.h Update generated files for int/char typedef removal (see #3507) 2023-06-01 19:32:36 +03:00