| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // The DownloadManager object manages the process of downloading, including | 5 // The DownloadManager object manages the process of downloading, including |
| 6 // updates to the history system and providing the information for displaying | 6 // updates to the history system and providing the information for displaying |
| 7 // the downloads view in the Destinations tab. There is one DownloadManager per | 7 // the downloads view in the Destinations tab. There is one DownloadManager per |
| 8 // active profile in Chrome. | 8 // active profile in Chrome. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 std::vector<DownloadCreateInfo>* entries); | 158 std::vector<DownloadCreateInfo>* entries); |
| 159 void OnCreateDownloadEntryComplete(DownloadCreateInfo info, int64 db_handle); | 159 void OnCreateDownloadEntryComplete(DownloadCreateInfo info, int64 db_handle); |
| 160 | 160 |
| 161 // Display a new download in the appropriate browser UI. | 161 // Display a new download in the appropriate browser UI. |
| 162 void ShowDownloadInBrowser(const DownloadCreateInfo& info, | 162 void ShowDownloadInBrowser(const DownloadCreateInfo& info, |
| 163 DownloadItem* download); | 163 DownloadItem* download); |
| 164 | 164 |
| 165 // Opens a download. For Chrome extensions call | 165 // Opens a download. For Chrome extensions call |
| 166 // ExtensionsServices::InstallExtension, for everything else call | 166 // ExtensionsServices::InstallExtension, for everything else call |
| 167 // OpenDownloadInShell. | 167 // OpenDownloadInShell. |
| 168 void OpenDownload(const DownloadItem* download, | 168 void OpenDownload(DownloadItem* download, gfx::NativeView parent_window); |
| 169 gfx::NativeView parent_window); | |
| 170 | 169 |
| 171 // Show a download via the Windows shell. | 170 // Show a download via the Windows shell. |
| 172 void ShowDownloadInShell(const DownloadItem* download); | 171 void ShowDownloadInShell(const DownloadItem* download); |
| 173 | 172 |
| 174 // The number of in progress (including paused) downloads. | 173 // The number of in progress (including paused) downloads. |
| 175 int in_progress_count() const { | 174 int in_progress_count() const { |
| 176 return static_cast<int>(in_progress_.size()); | 175 return static_cast<int>(in_progress_.size()); |
| 177 } | 176 } |
| 178 | 177 |
| 179 FilePath download_path() { return *download_path_; } | 178 FilePath download_path() { return *download_path_; } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // The original profile's download manager. | 230 // The original profile's download manager. |
| 232 DownloadManager* observed_download_manager_; | 231 DownloadManager* observed_download_manager_; |
| 233 }; | 232 }; |
| 234 | 233 |
| 235 friend class base::RefCountedThreadSafe<DownloadManager>; | 234 friend class base::RefCountedThreadSafe<DownloadManager>; |
| 236 friend class OtherDownloadManagerObserver; | 235 friend class OtherDownloadManagerObserver; |
| 237 | 236 |
| 238 ~DownloadManager(); | 237 ~DownloadManager(); |
| 239 | 238 |
| 240 // Opens a download via the Windows shell. | 239 // Opens a download via the Windows shell. |
| 241 void OpenDownloadInShell(const DownloadItem* download, | 240 void OpenDownloadInShell(DownloadItem* download, |
| 242 gfx::NativeView parent_window); | 241 gfx::NativeView parent_window); |
| 243 | 242 |
| 244 // Shutdown the download manager. This call is needed only after Init. | 243 // Shutdown the download manager. This call is needed only after Init. |
| 245 void Shutdown(); | 244 void Shutdown(); |
| 246 | 245 |
| 247 // Called on the download thread to check whether the suggested file path | 246 // Called on the download thread to check whether the suggested file path |
| 248 // exists. We don't check if the file exists on the UI thread to avoid UI | 247 // exists. We don't check if the file exists on the UI thread to avoid UI |
| 249 // stalls from interacting with the file system. | 248 // stalls from interacting with the file system. |
| 250 void CheckIfSuggestedPathExists(DownloadCreateInfo* info); | 249 void CheckIfSuggestedPathExists(DownloadCreateInfo* info); |
| 251 | 250 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // The "Save As" dialog box used to ask the user where a file should be | 373 // The "Save As" dialog box used to ask the user where a file should be |
| 375 // saved. | 374 // saved. |
| 376 scoped_refptr<SelectFileDialog> select_file_dialog_; | 375 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 377 | 376 |
| 378 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; | 377 scoped_ptr<OtherDownloadManagerObserver> other_download_manager_observer_; |
| 379 | 378 |
| 380 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 379 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 381 }; | 380 }; |
| 382 | 381 |
| 383 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 382 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |