chrome: Add ability to handle chrome menu/keyboard commands (fixes issue #3280)

This change adds a CefCommandHandler::OnChromeCommand callback for optionally
handling Chrome commands triggered via menus or keyboard shortcuts. Supported
command IDs are listed in a new cef_command_ids.h header file.

To test: Run `cefclient --enable-chrome-runtime --hide-controls`. Most commands
will blocked and removed from context menus.
This commit is contained in:
Marshall Greenblatt
2022-03-22 14:31:30 -04:00
parent 13ca38e4e0
commit 2f5838eaaa
44 changed files with 703 additions and 44 deletions

View File

@ -955,15 +955,66 @@ typedef enum {
///
typedef enum {
WOD_UNKNOWN,
///
// Current tab. This is the default in most cases.
///
WOD_CURRENT_TAB,
///
// Indicates that only one tab with the url should exist in the same window.
///
WOD_SINGLETON_TAB,
///
// Shift key + Middle mouse button or meta/ctrl key while clicking.
///
WOD_NEW_FOREGROUND_TAB,
///
// Middle mouse button or meta/ctrl key while clicking.
///
WOD_NEW_BACKGROUND_TAB,
///
// New popup window.
///
WOD_NEW_POPUP,
///
// Shift key while clicking.
///
WOD_NEW_WINDOW,
///
// Alt key while clicking.
///
WOD_SAVE_TO_DISK,
///
// New off-the-record (incognito) window.
///
WOD_OFF_THE_RECORD,
WOD_IGNORE_ACTION
///
// Special case error condition from the renderer.
///
WOD_IGNORE_ACTION,
///
// Activates an existing tab containing the url, rather than navigating.
// This is similar to SINGLETON_TAB, but searches across all windows from
// the current profile and anonymity (instead of just the current one);
// closes the current tab on switching if the current tab was the NTP with
// no session history; and behaves like CURRENT_TAB instead of
// NEW_FOREGROUND_TAB when no existing tab is found.
///
WOD_SWITCH_TO_TAB,
///
// Creates a new document picture-in-picture window showing a child WebView.
///
WOD_NEW_PICTURE_IN_PICTURE,
} cef_window_open_disposition_t;
///