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

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

Issue 12850002: Move download filename determintion into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 8 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/download_prefs.cc
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 2bfb7928e96259b62a0dbf21fd573489b576979a..f373d52d0851e8bf141c34a37ff248df7e415255 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -153,8 +153,13 @@ bool DownloadPrefs::IsAutoOpenUsed() const {
return !auto_open_.empty();
}
-bool DownloadPrefs::IsAutoOpenEnabledForExtension(
- const base::FilePath::StringType& extension) const {
+bool DownloadPrefs::IsAutoOpenEnabledBasedOnExtension(
+ const base::FilePath& path) const {
+ base::FilePath::StringType extension = path.Extension();
+ if (extension.empty())
+ return false;
+ DCHECK(extension[0] == base::FilePath::kExtensionSeparator);
+ extension.erase(0, 1);
return auto_open_.find(extension) != auto_open_.end();
}

Powered by Google App Engine
This is Rietveld 408576698