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

Unified Diff: chrome/browser/download/save_package.cc

Issue 2850042: Deprecate more old filepath functions. (Closed)
Patch Set: rebase Created 10 years, 5 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/download/save_package.cc
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc
index db34e3594b98d4c7a7657f05af0ee68468be66f9..f95ba7ce38fda5389d873133731a47af161ff3d1 100644
--- a/chrome/browser/download/save_package.cc
+++ b/chrome/browser/download/save_package.cc
@@ -1084,7 +1084,9 @@ FilePath SavePackage::GetSuggestedNameForSaveAs(const FilePath& name,
FilePath SavePackage::EnsureHtmlExtension(const FilePath& name) {
// If the file name doesn't have an extension suitable for HTML files,
// append one.
- FilePath::StringType ext = file_util::GetFileExtensionFromPath(name);
+ FilePath::StringType ext = name.Extension();
+ if (!ext.empty())
+ ext.erase(ext.begin()); // Erase preceding '.'.
std::string mime_type;
if (!net::GetMimeTypeFromExtension(ext, &mime_type) ||
!CanSaveAsComplete(mime_type)) {

Powered by Google App Engine
This is Rietveld 408576698