| 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/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // of the content check, if one is performed, will be ignored. | 132 // of the content check, if one is performed, will be ignored. |
| 133 danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL; | 133 danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL; |
| 134 } | 134 } |
| 135 callback.Run(danger_type); | 135 callback.Run(danger_type); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace | 138 } // namespace |
| 139 | 139 |
| 140 // static | 140 // static |
| 141 void ChromeDownloadManagerDelegate::RegisterUserPrefs( | 141 void ChromeDownloadManagerDelegate::RegisterUserPrefs( |
| 142 PrefRegistrySyncable* registry) { | 142 user_prefs::PrefRegistrySyncable* registry) { |
| 143 const base::FilePath& default_download_path = | 143 const base::FilePath& default_download_path = |
| 144 download_util::GetDefaultDownloadDirectory(); | 144 download_util::GetDefaultDownloadDirectory(); |
| 145 registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory, | 145 registry->RegisterFilePathPref( |
| 146 default_download_path, | 146 prefs::kSaveFileDefaultDirectory, |
| 147 PrefRegistrySyncable::UNSYNCABLE_PREF); | 147 default_download_path, |
| 148 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 148 } | 149 } |
| 149 | 150 |
| 150 ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) | 151 ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile) |
| 151 : profile_(profile), | 152 : profile_(profile), |
| 152 next_download_id_(0), | 153 next_download_id_(0), |
| 153 download_prefs_(new DownloadPrefs(profile)) { | 154 download_prefs_(new DownloadPrefs(profile)) { |
| 154 } | 155 } |
| 155 | 156 |
| 156 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { | 157 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { |
| 157 } | 158 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 registrar_.Remove(this, | 548 registrar_.Remove(this, |
| 548 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 549 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 549 source); | 550 source); |
| 550 | 551 |
| 551 scoped_refptr<extensions::CrxInstaller> installer = | 552 scoped_refptr<extensions::CrxInstaller> installer = |
| 552 content::Source<extensions::CrxInstaller>(source).ptr(); | 553 content::Source<extensions::CrxInstaller>(source).ptr(); |
| 553 content::DownloadOpenDelayedCallback callback = crx_installers_[installer]; | 554 content::DownloadOpenDelayedCallback callback = crx_installers_[installer]; |
| 554 crx_installers_.erase(installer.get()); | 555 crx_installers_.erase(installer.get()); |
| 555 callback.Run(installer->did_handle_successfully()); | 556 callback.Run(installer->did_handle_successfully()); |
| 556 } | 557 } |
| OLD | NEW |