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

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

Issue 14773004: Move download filename determination into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 dd72aa5baacc3d4759d7477de649f3fef55c2e1e..b40b78b8e7c025d79d855bd3cf697541f35e1817 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