Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm

Issue 8380021: Make all drag sources not depend on download_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: header path Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm
index fbd762a39d32dac0ed3509a8dc20c022bf5d2dec..12c401b1d4bd41ed70011e9bf0ac5987963f0cab 100644
--- a/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/web_drag_source.mm
@@ -14,12 +14,12 @@
#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/download/download_util.h"
#include "chrome/browser/tab_contents/tab_contents_view_mac.h"
#include "content/browser/download/drag_download_file.h"
#include "content/browser/download/drag_download_util.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/common/url_constants.h"
#include "net/base/file_stream.h"
#include "net/base/net_util.h"
@@ -402,11 +402,17 @@ void PromiseWriterTask::Run() {
&mimeType,
&fileName,
&downloadURL_)) {
- download_util::GenerateFileNameFromSuggestedName(
- downloadURL_,
- fileName.value(),
- UTF16ToUTF8(mimeType),
- &downloadFileName_);
+ // Generate the file name based on both mime type and proposed file
+ // name.
+ std::string defaultName =
+ content::GetContentClient()->browser()->GetDefaultDownloadName();
+ downloadFileName_ =
+ net::GenerateFileName(downloadURL_,
+ std::string(),
+ std::string(),
+ fileName.value(),
+ UTF16ToUTF8(mimeType),
+ defaultName);
fileExtension = SysUTF8ToNSString(downloadFileName_.Extension());
}
}
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698