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

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: Fix tests on Android 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
« no previous file with comments | « chrome/browser/download/download_prefs.h ('k') | chrome/browser/download/download_target_determiner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/download/download_prefs.h ('k') | chrome/browser/download/download_target_determiner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698