diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/content_browser_client.h | 4 | ||||
-rw-r--r-- | content/browser/download/save_package.cc | 2 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.cc | 4 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.h | 1 | ||||
-rw-r--r-- | content/shell/shell_content_browser_client.cc | 4 | ||||
-rw-r--r-- | content/shell/shell_content_browser_client.h | 1 | ||||
-rw-r--r-- | content/shell/shell_download_manager_delegate.cc | 2 |
7 files changed, 16 insertions, 2 deletions
diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index 29d386e..6715ef8 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -322,6 +322,10 @@ class ContentBrowserClient { // This can be called on any thread. virtual FilePath GetDefaultDownloadDirectory() = 0; + // Returns the default filename used in downloads when we have no idea what + // else we should do with the file. + virtual std::string GetDefaultDownloadName() = 0; + #if defined(OS_POSIX) && !defined(OS_MACOSX) // Can return an optional fd for crash handling, otherwise returns -1. The // passed |command_line| will be used to start the process in question. diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index 2574232..308eff2 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -364,7 +364,7 @@ bool SavePackage::GenerateFileName(const std::string& disposition, // TODO(jungshik): Figure out the referrer charset when having one // makes sense and pass it to GenerateFileName. FilePath file_path = net::GenerateFileName(url, disposition, "", "", "", - ASCIIToUTF16(kDefaultSaveName)); + kDefaultSaveName); DCHECK(!file_path.empty()); FilePath::StringType pure_file_name = diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index f9a49cb..9f6316d 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -278,6 +278,10 @@ FilePath MockContentBrowserClient::GetDefaultDownloadDirectory() { return download_dir_.path(); } +std::string MockContentBrowserClient::GetDefaultDownloadName() { + return std::string(); +} + #if defined(OS_POSIX) && !defined(OS_MACOSX) int MockContentBrowserClient::GetCrashSignalFD( const CommandLine& command_line) { diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index e52956e..c46c4e6 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -130,6 +130,7 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual void ClearCache(RenderViewHost* rvh) OVERRIDE; virtual void ClearCookies(RenderViewHost* rvh) OVERRIDE; virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; + virtual std::string GetDefaultDownloadName() OVERRIDE; #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual int GetCrashSignalFD(const CommandLine& command_line) OVERRIDE; diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 5b60e7f..a97abf5 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -287,6 +287,10 @@ FilePath ShellContentBrowserClient::GetDefaultDownloadDirectory() { return FilePath(); } +std::string ShellContentBrowserClient::GetDefaultDownloadName() { + return "download"; +} + #if defined(OS_POSIX) && !defined(OS_MACOSX) int ShellContentBrowserClient::GetCrashSignalFD( const CommandLine& command_line) { diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 0fd85db..77aa5df 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -143,6 +143,7 @@ class ShellContentBrowserClient : public ContentBrowserClient virtual void ClearCache(RenderViewHost* rvh) OVERRIDE; virtual void ClearCookies(RenderViewHost* rvh) OVERRIDE; virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; + virtual std::string GetDefaultDownloadName() OVERRIDE; #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual int GetCrashSignalFD(const CommandLine& command_line) OVERRIDE; diff --git a/content/shell/shell_download_manager_delegate.cc b/content/shell/shell_download_manager_delegate.cc index a023d78..3b14c89 100644 --- a/content/shell/shell_download_manager_delegate.cc +++ b/content/shell/shell_download_manager_delegate.cc @@ -53,7 +53,7 @@ bool ShellDownloadManagerDelegate::ShouldStartDownload(int32 download_id) { download->referrer_charset(), download->suggested_filename(), download->mime_type(), - string16(UTF8ToUTF16("download"))); + "download"); // Since we have no download UI, show the user a dialog always. state.prompt_user_for_save_location = true; |