mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-26 17:42:35 +01:00
Add CefContextMenuParams::GetTitleText method (issue #2030)
This commit is contained in:
parent
3f0c94f7e6
commit
5f4190ff75
@ -192,6 +192,14 @@ typedef struct _cef_context_menu_params_t {
|
||||
int (CEF_CALLBACK *has_image_contents)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the title text or the alt text if the context menu was invoked on
|
||||
// an image.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_title_text)(
|
||||
struct _cef_context_menu_params_t* self);
|
||||
|
||||
///
|
||||
// Returns the URL of the top level page that the context menu was invoked on.
|
||||
///
|
||||
|
@ -195,6 +195,13 @@ class CefContextMenuParams : public virtual CefBase {
|
||||
/*--cef()--*/
|
||||
virtual bool HasImageContents() =0;
|
||||
|
||||
///
|
||||
// Returns the title text or the alt text if the context menu was invoked on
|
||||
// an image.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetTitleText() = 0;
|
||||
|
||||
///
|
||||
// Returns the URL of the top level page that the context menu was invoked on.
|
||||
///
|
||||
|
@ -64,6 +64,11 @@ bool CefContextMenuParamsImpl::HasImageContents() {
|
||||
return const_value().has_image_contents;
|
||||
}
|
||||
|
||||
CefString CefContextMenuParamsImpl::GetTitleText() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
||||
return const_value().title_text;
|
||||
}
|
||||
|
||||
CefString CefContextMenuParamsImpl::GetPageUrl() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
||||
return const_value().page_url.spec();
|
||||
|
@ -25,6 +25,7 @@ class CefContextMenuParamsImpl
|
||||
CefString GetUnfilteredLinkUrl() override;
|
||||
CefString GetSourceUrl() override;
|
||||
bool HasImageContents() override;
|
||||
CefString GetTitleText() override;
|
||||
CefString GetPageUrl() override;
|
||||
CefString GetFrameUrl() override;
|
||||
CefString GetFrameCharset() override;
|
||||
|
@ -125,6 +125,21 @@ int CEF_CALLBACK context_menu_params_has_image_contents(
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK context_menu_params_get_title_text(
|
||||
struct _cef_context_menu_params_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefContextMenuParamsCppToC::Get(self)->GetTitleText();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK context_menu_params_get_page_url(
|
||||
struct _cef_context_menu_params_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@ -352,6 +367,7 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() {
|
||||
context_menu_params_get_unfiltered_link_url;
|
||||
GetStruct()->get_source_url = context_menu_params_get_source_url;
|
||||
GetStruct()->has_image_contents = context_menu_params_has_image_contents;
|
||||
GetStruct()->get_title_text = context_menu_params_get_title_text;
|
||||
GetStruct()->get_page_url = context_menu_params_get_page_url;
|
||||
GetStruct()->get_frame_url = context_menu_params_get_frame_url;
|
||||
GetStruct()->get_frame_charset = context_menu_params_get_frame_charset;
|
||||
|
@ -120,6 +120,22 @@ bool CefContextMenuParamsCToCpp::HasImageContents() {
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefString CefContextMenuParamsCToCpp::GetTitleText() {
|
||||
cef_context_menu_params_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_title_text))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = _struct->get_title_text(_struct);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefContextMenuParamsCToCpp::GetPageUrl() {
|
||||
cef_context_menu_params_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_page_url))
|
||||
|
@ -39,6 +39,7 @@ class CefContextMenuParamsCToCpp
|
||||
CefString GetUnfilteredLinkUrl() OVERRIDE;
|
||||
CefString GetSourceUrl() OVERRIDE;
|
||||
bool HasImageContents() OVERRIDE;
|
||||
CefString GetTitleText() OVERRIDE;
|
||||
CefString GetPageUrl() OVERRIDE;
|
||||
CefString GetFrameUrl() OVERRIDE;
|
||||
CefString GetFrameCharset() OVERRIDE;
|
||||
|
Loading…
Reference in New Issue
Block a user