| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/download/download_prefs.h" | 5 #include "chrome/browser/download/download_prefs.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/download/download_extensions.h" | 13 #include "chrome/browser/download/download_extensions.h" |
| 14 #include "chrome/browser/download/download_util.h" | 14 #include "chrome/browser/download/download_util.h" |
| 15 #include "chrome/browser/download/save_package.h" | |
| 16 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 18 #include "content/browser/browser_thread.h" | 17 #include "content/browser/browser_thread.h" |
| 18 #include "content/browser/download/save_package.h" |
| 19 | 19 |
| 20 DownloadPrefs::DownloadPrefs(PrefService* prefs) : prefs_(prefs) { | 20 DownloadPrefs::DownloadPrefs(PrefService* prefs) : prefs_(prefs) { |
| 21 prompt_for_download_.Init(prefs::kPromptForDownload, prefs, NULL); | 21 prompt_for_download_.Init(prefs::kPromptForDownload, prefs, NULL); |
| 22 download_path_.Init(prefs::kDownloadDefaultDirectory, prefs, NULL); | 22 download_path_.Init(prefs::kDownloadDefaultDirectory, prefs, NULL); |
| 23 save_file_type_.Init(prefs::kSaveFileType, prefs, NULL); | 23 save_file_type_.Init(prefs::kSaveFileType, prefs, NULL); |
| 24 | 24 |
| 25 // We store any file extension that should be opened automatically at | 25 // We store any file extension that should be opened automatically at |
| 26 // download completion in this pref. | 26 // download completion in this pref. |
| 27 std::string extensions_to_open = | 27 std::string extensions_to_open = |
| 28 prefs->GetString(prefs::kDownloadExtensionsToOpen); | 28 prefs->GetString(prefs::kDownloadExtensionsToOpen); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 extensions.erase(extensions.size() - 1); | 151 extensions.erase(extensions.size() - 1); |
| 152 | 152 |
| 153 prefs_->SetString(prefs::kDownloadExtensionsToOpen, extensions); | 153 prefs_->SetString(prefs::kDownloadExtensionsToOpen, extensions); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( | 156 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( |
| 157 const FilePath::StringType& a, | 157 const FilePath::StringType& a, |
| 158 const FilePath::StringType& b) const { | 158 const FilePath::StringType& b) const { |
| 159 return FilePath::CompareLessIgnoreCase(a, b); | 159 return FilePath::CompareLessIgnoreCase(a, b); |
| 160 } | 160 } |
| OLD | NEW |