| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (!extensions[i].empty() && | 75 if (!extensions[i].empty() && |
| 76 download_util::GetFileDangerLevel(path) == download_util::NOT_DANGEROUS) | 76 download_util::GetFileDangerLevel(path) == download_util::NOT_DANGEROUS) |
| 77 auto_open_.insert(path.value()); | 77 auto_open_.insert(path.value()); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 DownloadPrefs::~DownloadPrefs() { | 81 DownloadPrefs::~DownloadPrefs() { |
| 82 } | 82 } |
| 83 | 83 |
| 84 // static | 84 // static |
| 85 void DownloadPrefs::RegisterUserPrefs( | 85 void DownloadPrefs::RegisterProfilePrefs( |
| 86 user_prefs::PrefRegistrySyncable* registry) { | 86 user_prefs::PrefRegistrySyncable* registry) { |
| 87 registry->RegisterBooleanPref( | 87 registry->RegisterBooleanPref( |
| 88 prefs::kPromptForDownload, | 88 prefs::kPromptForDownload, |
| 89 false, | 89 false, |
| 90 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 90 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 91 registry->RegisterStringPref( | 91 registry->RegisterStringPref( |
| 92 prefs::kDownloadExtensionsToOpen, | 92 prefs::kDownloadExtensionsToOpen, |
| 93 std::string(), | 93 std::string(), |
| 94 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 94 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 95 registry->RegisterBooleanPref( | 95 registry->RegisterBooleanPref( |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 extensions.erase(extensions.size() - 1); | 236 extensions.erase(extensions.size() - 1); |
| 237 | 237 |
| 238 profile_->GetPrefs()->SetString(prefs::kDownloadExtensionsToOpen, extensions); | 238 profile_->GetPrefs()->SetString(prefs::kDownloadExtensionsToOpen, extensions); |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( | 241 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( |
| 242 const base::FilePath::StringType& a, | 242 const base::FilePath::StringType& a, |
| 243 const base::FilePath::StringType& b) const { | 243 const base::FilePath::StringType& b) const { |
| 244 return base::FilePath::CompareLessIgnoreCase(a, b); | 244 return base::FilePath::CompareLessIgnoreCase(a, b); |
| 245 } | 245 } |
| OLD | NEW |