From 78c653a2edd121bc31d7ea82f5f8d110c2bb2d9c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 18 Feb 2022 16:44:37 -0500 Subject: [PATCH] Update context menu type enums to match Chromium (fixes issue #3257) --- include/cef_api_hash.h | 8 ++++---- include/internal/cef_types.h | 31 ++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 0309e98e1..9b5de0f59 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "6f6a9c0f3b420cd3120cf4f5924cbc91f5095abd" +#define CEF_API_HASH_UNIVERSAL "bce1c03dd10e25bb5b1c4130297486205e7a8e56" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "5835e67ed251fec96837b475df44248a286e422f" +#define CEF_API_HASH_PLATFORM "cb4f19f13d7a944d1cd0ea6fa3a5129d356cd9d5" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "b8187d9f99b028d767dfd6a40490190c25a3d901" +#define CEF_API_HASH_PLATFORM "6c37c43a7f7d206a54297068fcbe3ca4905a17cb" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "d7199dfd396052e1517e55f18ea75d3d61336538" +#define CEF_API_HASH_PLATFORM "3572e1eca7185fdcdcff550f7b1759f4647e3e04" #endif #ifdef __cplusplus diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 007bd173c..401850690 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -1028,7 +1028,8 @@ typedef enum { } cef_postdataelement_type_t; /// -// Resource type for a request. +// Resource type for a request. These constants match their equivalents in +// Chromium's ResourceType and should not be renumbered. /// typedef enum { /// @@ -1616,8 +1617,7 @@ typedef enum { MENU_ID_NO_SPELLING_SUGGESTIONS = 205, MENU_ID_ADD_TO_DICTIONARY = 206, - // Custom menu items originating from the renderer process. For example, - // plugin placeholder menu items. + // Custom menu items originating from the renderer process. MENU_ID_CUSTOM_FIRST = 220, MENU_ID_CUSTOM_LAST = 250, @@ -1819,7 +1819,8 @@ typedef enum { } cef_context_menu_type_flags_t; /// -// Supported context menu media types. +// Supported context menu media types. These constants match their equivalents +// in Chromium's ContextMenuDataMediaType and should not be renumbered. /// typedef enum { /// @@ -1839,6 +1840,10 @@ typedef enum { /// CM_MEDIATYPE_AUDIO, /// + // An canvas node is selected. + /// + CM_MEDIATYPE_CANVAS, + /// // A file node is selected. /// CM_MEDIATYPE_FILE, @@ -1849,24 +1854,31 @@ typedef enum { } cef_context_menu_media_type_t; /// -// Supported context menu media state bit flags. +// Supported context menu media state bit flags. These constants match their +// equivalents in Chromium's ContextMenuData::MediaFlags and should not be +// renumbered. /// typedef enum { CM_MEDIAFLAG_NONE = 0, - CM_MEDIAFLAG_ERROR = 1 << 0, + CM_MEDIAFLAG_IN_ERROR = 1 << 0, CM_MEDIAFLAG_PAUSED = 1 << 1, CM_MEDIAFLAG_MUTED = 1 << 2, CM_MEDIAFLAG_LOOP = 1 << 3, CM_MEDIAFLAG_CAN_SAVE = 1 << 4, CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, - CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, - CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, + CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6, + CM_MEDIAFLAG_CONTROLS = 1 << 7, CM_MEDIAFLAG_CAN_PRINT = 1 << 8, CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, + CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10, + CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11, + CM_MEDIAFLAG_CAN_LOOP = 1 << 12, } cef_context_menu_media_state_flags_t; /// -// Supported context menu edit state bit flags. +// Supported context menu edit state bit flags. These constants match their +// equivalents in Chromium's ContextMenuDataEditFlags and should not be +// renumbered. /// typedef enum { CM_EDITFLAG_NONE = 0, @@ -1878,6 +1890,7 @@ typedef enum { CM_EDITFLAG_CAN_DELETE = 1 << 5, CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, + CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8, } cef_context_menu_edit_state_flags_t; ///