| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // Each download is represented by a DownloadItem, and all DownloadItems | 10 // Each download is represented by a DownloadItem, and all DownloadItems |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // Constructing from persistent store: | 103 // Constructing from persistent store: |
| 104 DownloadItem(const DownloadCreateInfo& info); | 104 DownloadItem(const DownloadCreateInfo& info); |
| 105 | 105 |
| 106 // Constructing from user action: | 106 // Constructing from user action: |
| 107 DownloadItem(int32 download_id, | 107 DownloadItem(int32 download_id, |
| 108 const FilePath& path, | 108 const FilePath& path, |
| 109 int path_uniquifier, | 109 int path_uniquifier, |
| 110 const GURL& url, | 110 const GURL& url, |
| 111 const GURL& referrer_url, | 111 const GURL& referrer_url, |
| 112 const std::string& mime_type, |
| 112 const FilePath& original_name, | 113 const FilePath& original_name, |
| 113 const base::Time start_time, | 114 const base::Time start_time, |
| 114 int64 download_size, | 115 int64 download_size, |
| 115 int render_process_id, | 116 int render_process_id, |
| 116 int request_id, | 117 int request_id, |
| 117 bool is_dangerous); | 118 bool is_dangerous); |
| 118 | 119 |
| 119 ~DownloadItem(); | 120 ~DownloadItem(); |
| 120 | 121 |
| 121 void Init(bool start_timer); | 122 void Init(bool start_timer); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Accessors | 180 // Accessors |
| 180 DownloadState state() const { return state_; } | 181 DownloadState state() const { return state_; } |
| 181 FilePath file_name() const { return file_name_; } | 182 FilePath file_name() const { return file_name_; } |
| 182 void set_file_name(const FilePath& name) { file_name_ = name; } | 183 void set_file_name(const FilePath& name) { file_name_ = name; } |
| 183 FilePath full_path() const { return full_path_; } | 184 FilePath full_path() const { return full_path_; } |
| 184 void set_full_path(const FilePath& path) { full_path_ = path; } | 185 void set_full_path(const FilePath& path) { full_path_ = path; } |
| 185 int path_uniquifier() const { return path_uniquifier_; } | 186 int path_uniquifier() const { return path_uniquifier_; } |
| 186 void set_path_uniquifier(int uniquifier) { path_uniquifier_ = uniquifier; } | 187 void set_path_uniquifier(int uniquifier) { path_uniquifier_ = uniquifier; } |
| 187 GURL url() const { return url_; } | 188 GURL url() const { return url_; } |
| 188 GURL referrer_url() const { return referrer_url_; } | 189 GURL referrer_url() const { return referrer_url_; } |
| 190 std::string mime_type() const { return mime_type_; } |
| 189 int64 total_bytes() const { return total_bytes_; } | 191 int64 total_bytes() const { return total_bytes_; } |
| 190 void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; } | 192 void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; } |
| 191 int64 received_bytes() const { return received_bytes_; } | 193 int64 received_bytes() const { return received_bytes_; } |
| 192 int32 id() const { return id_; } | 194 int32 id() const { return id_; } |
| 193 base::Time start_time() const { return start_time_; } | 195 base::Time start_time() const { return start_time_; } |
| 194 void set_db_handle(int64 handle) { db_handle_ = handle; } | 196 void set_db_handle(int64 handle) { db_handle_ = handle; } |
| 195 int64 db_handle() const { return db_handle_; } | 197 int64 db_handle() const { return db_handle_; } |
| 196 DownloadManager* manager() const { return manager_; } | 198 DownloadManager* manager() const { return manager_; } |
| 197 void set_manager(DownloadManager* manager) { manager_ = manager; } | 199 void set_manager(DownloadManager* manager) { manager_ = manager; } |
| 198 bool is_paused() const { return is_paused_; } | 200 bool is_paused() const { return is_paused_; } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 233 |
| 232 // Short display version of the file | 234 // Short display version of the file |
| 233 FilePath file_name_; | 235 FilePath file_name_; |
| 234 | 236 |
| 235 // The URL from whence we came. | 237 // The URL from whence we came. |
| 236 GURL url_; | 238 GURL url_; |
| 237 | 239 |
| 238 // The URL of the page that initiated the download. | 240 // The URL of the page that initiated the download. |
| 239 GURL referrer_url_; | 241 GURL referrer_url_; |
| 240 | 242 |
| 243 // The mimetype of the download |
| 244 std::string mime_type_; |
| 245 |
| 241 // Total bytes expected | 246 // Total bytes expected |
| 242 int64 total_bytes_; | 247 int64 total_bytes_; |
| 243 | 248 |
| 244 // Current received bytes | 249 // Current received bytes |
| 245 int64 received_bytes_; | 250 int64 received_bytes_; |
| 246 | 251 |
| 247 // Start time for calculating remaining time | 252 // Start time for calculating remaining time |
| 248 base::TimeTicks start_tick_; | 253 base::TimeTicks start_tick_; |
| 249 | 254 |
| 250 // The current state of this download | 255 // The current state of this download |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 PendingFinishedMap pending_finished_downloads_; | 609 PendingFinishedMap pending_finished_downloads_; |
| 605 | 610 |
| 606 // The "Save As" dialog box used to ask the user where a file should be | 611 // The "Save As" dialog box used to ask the user where a file should be |
| 607 // saved. | 612 // saved. |
| 608 scoped_refptr<SelectFileDialog> select_file_dialog_; | 613 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 609 | 614 |
| 610 DISALLOW_COPY_AND_ASSIGN(DownloadManager); | 615 DISALLOW_COPY_AND_ASSIGN(DownloadManager); |
| 611 }; | 616 }; |
| 612 | 617 |
| 613 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ | 618 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |