mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add the CefHandler::HandleDownloadResponse() method and CefDownloadHandler class to support file download in response to 'Content-Disposition' headers (issue #6).
- Fix parsing error in cef_parser.py due to space between angle brackets in template type definitions, and add support for int64 type. - Update copyright messages in Python and generated files. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@117 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "Cache.h"
|
||||
#include "TextEncoding.h"
|
||||
#include "third_party/WebKit/WebCore/platform/network/HTTPParsers.h"
|
||||
#include "third_party/WebKit/WebKit/chromium/src/WebFrameImpl.h"
|
||||
MSVC_POP_WARNING();
|
||||
|
||||
@@ -145,4 +146,20 @@ void EnableSpdy(bool enable) {
|
||||
// Used in benchmarking, Ignored for CEF.
|
||||
}
|
||||
|
||||
bool IsContentDispositionAttachment(const std::string& cd_header,
|
||||
std::string& file_name) {
|
||||
WTF::String cd_str(cd_header.c_str(), cd_header.length());
|
||||
if (WebCore::contentDispositionType(cd_str) ==
|
||||
WebCore::ContentDispositionAttachment) {
|
||||
WTF::String name_str =
|
||||
WebCore::filenameFromHTTPContentDisposition(cd_str);
|
||||
if (!name_str.isEmpty()) {
|
||||
file_name = WideToUTF8(
|
||||
std::wstring(name_str.characters(), name_str.length()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace webkit_glue
|
||||
|
Reference in New Issue
Block a user