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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
166 registry->RegisterFilePathPref( | 166 registry->RegisterFilePathPref( |
167 prefs::kSaveFileDefaultDirectory, | 167 prefs::kSaveFileDefaultDirectory, |
168 default_download_path, | 168 default_download_path, |
169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
170 | 170 |
171 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
172 // Ensure that the download directory specified in the preferences exists. | 172 // Ensure that the download directory specified in the preferences exists. |
173 BrowserThread::PostTask( | 173 BrowserThread::PostTask( |
174 BrowserThread::FILE, FROM_HERE, | 174 BrowserThread::FILE, FROM_HERE, |
175 base::Bind(base::IgnoreResult(&file_util::CreateDirectory), | 175 base::Bind(base::IgnoreResult(&base::CreateDirectory), |
176 default_download_path)); | 176 default_download_path)); |
177 #endif // defined(OS_CHROMEOS) | 177 #endif // defined(OS_CHROMEOS) |
178 } | 178 } |
179 | 179 |
180 // static | 180 // static |
181 const base::FilePath& DownloadPrefs::GetDefaultDownloadDirectory() { | 181 const base::FilePath& DownloadPrefs::GetDefaultDownloadDirectory() { |
182 return g_default_download_directory.Get().path(); | 182 return g_default_download_directory.Get().path(); |
183 } | 183 } |
184 | 184 |
185 // static | 185 // static |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 extensions.erase(extensions.size() - 1); | 299 extensions.erase(extensions.size() - 1); |
300 | 300 |
301 profile_->GetPrefs()->SetString(prefs::kDownloadExtensionsToOpen, extensions); | 301 profile_->GetPrefs()->SetString(prefs::kDownloadExtensionsToOpen, extensions); |
302 } | 302 } |
303 | 303 |
304 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( | 304 bool DownloadPrefs::AutoOpenCompareFunctor::operator()( |
305 const base::FilePath::StringType& a, | 305 const base::FilePath::StringType& a, |
306 const base::FilePath::StringType& b) const { | 306 const base::FilePath::StringType& b) const { |
307 return base::FilePath::CompareLessIgnoreCase(a, b); | 307 return base::FilePath::CompareLessIgnoreCase(a, b); |
308 } | 308 } |
OLD | NEW |