| 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 #ifndef CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 void SetNextId(uint32 id); | 164 void SetNextId(uint32 id); |
| 165 | 165 |
| 166 void ReturnNextId(const content::DownloadIdCallback& callback); | 166 void ReturnNextId(const content::DownloadIdCallback& callback); |
| 167 | 167 |
| 168 void OnDownloadTargetDetermined( | 168 void OnDownloadTargetDetermined( |
| 169 int32 download_id, | 169 int32 download_id, |
| 170 const content::DownloadTargetCallback& callback, | 170 const content::DownloadTargetCallback& callback, |
| 171 scoped_ptr<DownloadTargetInfo> target_info); | 171 scoped_ptr<DownloadTargetInfo> target_info); |
| 172 | 172 |
| 173 // Returns true if |path| should open in the browser. |
| 174 bool IsOpenInBrowserPreferreredForFile(const base::FilePath& path); |
| 175 |
| 173 Profile* profile_; | 176 Profile* profile_; |
| 174 uint32 next_download_id_; | 177 uint32 next_download_id_; |
| 175 IdCallbackVector id_callbacks_; | 178 IdCallbackVector id_callbacks_; |
| 176 scoped_ptr<DownloadPrefs> download_prefs_; | 179 scoped_ptr<DownloadPrefs> download_prefs_; |
| 177 | 180 |
| 178 #if defined(ENABLE_EXTENSIONS) | 181 #if defined(ENABLE_EXTENSIONS) |
| 179 // Maps from pending extension installations to DownloadItem IDs. | 182 // Maps from pending extension installations to DownloadItem IDs. |
| 180 typedef base::hash_map<extensions::CrxInstaller*, | 183 typedef base::hash_map<extensions::CrxInstaller*, |
| 181 content::DownloadOpenDelayedCallback> CrxInstallerMap; | 184 content::DownloadOpenDelayedCallback> CrxInstallerMap; |
| 182 CrxInstallerMap crx_installers_; | 185 CrxInstallerMap crx_installers_; |
| 183 #endif | 186 #endif |
| 184 | 187 |
| 185 content::NotificationRegistrar registrar_; | 188 content::NotificationRegistrar registrar_; |
| 186 | 189 |
| 187 base::WeakPtrFactory<ChromeDownloadManagerDelegate> weak_ptr_factory_; | 190 base::WeakPtrFactory<ChromeDownloadManagerDelegate> weak_ptr_factory_; |
| 188 | 191 |
| 189 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 192 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
| 190 }; | 193 }; |
| 191 | 194 |
| 192 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 195 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |