Add CefDownloadItem::GetOriginalUrl method (issue #1201).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1976 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
8a35083b8f
commit
c71cae325f
|
@ -125,6 +125,13 @@ typedef struct _cef_download_item_t {
|
|||
cef_string_userfree_t (CEF_CALLBACK *get_url)(
|
||||
struct _cef_download_item_t* self);
|
||||
|
||||
///
|
||||
// Returns the original URL before any redirections.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_original_url)(
|
||||
struct _cef_download_item_t* self);
|
||||
|
||||
///
|
||||
// Returns the suggested file name.
|
||||
///
|
||||
|
|
|
@ -126,6 +126,12 @@ class CefDownloadItem : public virtual CefBase {
|
|||
/*--cef()--*/
|
||||
virtual CefString GetURL() =0;
|
||||
|
||||
///
|
||||
// Returns the original URL before any redirections.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefString GetOriginalUrl() =0;
|
||||
|
||||
///
|
||||
// Returns the suggested file name.
|
||||
///
|
||||
|
|
|
@ -86,6 +86,11 @@ CefString CefDownloadItemImpl::GetURL() {
|
|||
return const_value().GetURL().spec();
|
||||
}
|
||||
|
||||
CefString CefDownloadItemImpl::GetOriginalUrl() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
||||
return const_value().GetOriginalUrl().spec();
|
||||
}
|
||||
|
||||
CefString CefDownloadItemImpl::GetSuggestedFileName() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
||||
return const_value().GetSuggestedFilename();
|
||||
|
|
|
@ -33,6 +33,7 @@ class CefDownloadItemImpl
|
|||
CefString GetFullPath() override;
|
||||
uint32 GetId() override;
|
||||
CefString GetURL() override;
|
||||
CefString GetOriginalUrl() override;
|
||||
CefString GetSuggestedFileName() override;
|
||||
CefString GetContentDisposition() override;
|
||||
CefString GetMimeType() override;
|
||||
|
|
|
@ -206,6 +206,21 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_url(
|
|||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK download_item_get_original_url(
|
||||
struct _cef_download_item_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefDownloadItemCppToC::Get(self)->GetOriginalUrl();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK download_item_get_suggested_file_name(
|
||||
struct _cef_download_item_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
@ -270,6 +285,7 @@ CefDownloadItemCppToC::CefDownloadItemCppToC(CefDownloadItem* cls)
|
|||
struct_.struct_.get_full_path = download_item_get_full_path;
|
||||
struct_.struct_.get_id = download_item_get_id;
|
||||
struct_.struct_.get_url = download_item_get_url;
|
||||
struct_.struct_.get_original_url = download_item_get_original_url;
|
||||
struct_.struct_.get_suggested_file_name =
|
||||
download_item_get_suggested_file_name;
|
||||
struct_.struct_.get_content_disposition =
|
||||
|
|
|
@ -188,6 +188,21 @@ CefString CefDownloadItemCToCpp::GetURL() {
|
|||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDownloadItemCToCpp::GetOriginalUrl() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_original_url))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_original_url(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDownloadItemCToCpp::GetSuggestedFileName() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_suggested_file_name))
|
||||
return CefString();
|
||||
|
|
|
@ -46,6 +46,7 @@ class CefDownloadItemCToCpp
|
|||
virtual CefString GetFullPath() OVERRIDE;
|
||||
virtual uint32 GetId() OVERRIDE;
|
||||
virtual CefString GetURL() OVERRIDE;
|
||||
virtual CefString GetOriginalUrl() OVERRIDE;
|
||||
virtual CefString GetSuggestedFileName() OVERRIDE;
|
||||
virtual CefString GetContentDisposition() OVERRIDE;
|
||||
virtual CefString GetMimeType() OVERRIDE;
|
||||
|
|
Loading…
Reference in New Issue