| Index: third_party/WebKit/Source/platform/network/NetworkUtils.cpp
|
| diff --git a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
|
| index f64443e3fae98967748feadbb01f39d9cb657cc8..83702b1f80351e4d1f87afb5ed496a7e44bd3a63 100644
|
| --- a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
|
| +++ b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
|
| @@ -4,9 +4,14 @@
|
|
|
| #include "platform/network/NetworkUtils.h"
|
|
|
| +#include "base/strings/string16.h"
|
| +#include "net/base/filename_util.h"
|
| #include "net/base/ip_address.h"
|
| #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
| #include "net/base/url_util.h"
|
| +#include "public/platform/URLConversion.h"
|
| +#include "public/platform/WebString.h"
|
| +#include "url/gurl.h"
|
| #include "wtf/text/StringUTF8Adaptor.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| @@ -53,6 +58,20 @@ String getDomainAndRegistry(const String& host, PrivateRegistryFilter filter) {
|
| return String(domain.data(), domain.length());
|
| }
|
|
|
| +String getSuggestedFilename(const KURL& url, const String& contentDisposition) {
|
| + // TODO(jungshik): Thread in the actual value of the referrer charset and pass
|
| + // it to GetSuggestedFilename.
|
| + CString disposition = contentDisposition.utf8();
|
| + base::string16 filename = net::GetSuggestedFilename(
|
| + WebStringToGURL(WebString(url.getString())),
|
| + std::string(disposition.data(), disposition.length()),
|
| + std::string(), // referrer_charset
|
| + std::string(), // suggested_name
|
| + std::string(), // mime_type
|
| + std::string()); // default_name
|
| + return String(filename.data(), filename.length());
|
| +}
|
| +
|
| } // NetworkUtils
|
|
|
| } // namespace blink
|
|
|