| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Each download is represented by a DownloadItem, and all DownloadItems | 5 // Each download is represented by a DownloadItem, and all DownloadItems |
| 6 // are owned by the DownloadManager which maintains a global list of all | 6 // are owned by the DownloadManager which maintains a global list of all |
| 7 // downloads. DownloadItems are created when a user initiates a download, | 7 // downloads. DownloadItems are created when a user initiates a download, |
| 8 // and exist for the duration of the browser life time. | 8 // and exist for the duration of the browser life time. |
| 9 // | 9 // |
| 10 // Download observers: | 10 // Download observers: |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 DownloadState state() const { return state_; } | 259 DownloadState state() const { return state_; } |
| 260 const FilePath& full_path() const { return full_path_; } | 260 const FilePath& full_path() const { return full_path_; } |
| 261 void set_path_uniquifier(int uniquifier) { | 261 void set_path_uniquifier(int uniquifier) { |
| 262 state_info_.path_uniquifier = uniquifier; | 262 state_info_.path_uniquifier = uniquifier; |
| 263 } | 263 } |
| 264 const GURL& GetURL() const; | 264 const GURL& GetURL() const; |
| 265 | 265 |
| 266 const std::vector<GURL>& url_chain() const { return url_chain_; } | 266 const std::vector<GURL>& url_chain() const { return url_chain_; } |
| 267 const GURL& original_url() const { return url_chain_.front(); } | 267 const GURL& original_url() const { return url_chain_.front(); } |
| 268 const GURL& referrer_url() const { return referrer_url_; } | 268 const GURL& referrer_url() const { return referrer_url_; } |
| 269 std::string suggested_filename() const { return suggested_filename_; } |
| 269 std::string content_disposition() const { return content_disposition_; } | 270 std::string content_disposition() const { return content_disposition_; } |
| 270 std::string mime_type() const { return mime_type_; } | 271 std::string mime_type() const { return mime_type_; } |
| 271 std::string original_mime_type() const { return original_mime_type_; } | 272 std::string original_mime_type() const { return original_mime_type_; } |
| 272 std::string referrer_charset() const { return referrer_charset_; } | 273 std::string referrer_charset() const { return referrer_charset_; } |
| 273 int64 total_bytes() const { return total_bytes_; } | 274 int64 total_bytes() const { return total_bytes_; } |
| 274 void set_total_bytes(int64 total_bytes) { | 275 void set_total_bytes(int64 total_bytes) { |
| 275 total_bytes_ = total_bytes; | 276 total_bytes_ = total_bytes; |
| 276 } | 277 } |
| 277 int64 received_bytes() const { return received_bytes_; } | 278 int64 received_bytes() const { return received_bytes_; } |
| 278 int32 id() const { return download_id_; } | 279 int32 id() const { return download_id_; } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // A number that should be appended to the path to make it unique, or 0 if the | 388 // A number that should be appended to the path to make it unique, or 0 if the |
| 388 // path should be used as is. | 389 // path should be used as is. |
| 389 int path_uniquifier_; | 390 int path_uniquifier_; |
| 390 | 391 |
| 391 // The chain of redirects that leading up to and including the final URL. | 392 // The chain of redirects that leading up to and including the final URL. |
| 392 std::vector<GURL> url_chain_; | 393 std::vector<GURL> url_chain_; |
| 393 | 394 |
| 394 // The URL of the page that initiated the download. | 395 // The URL of the page that initiated the download. |
| 395 GURL referrer_url_; | 396 GURL referrer_url_; |
| 396 | 397 |
| 398 // Suggested filename in 'download' attribute of an anchor. Details: |
| 399 // http://www.whatwg.org/specs/web-apps/current-work/#downloading-hyperlinks |
| 400 std::string suggested_filename_; |
| 401 |
| 397 // Information from the request. | 402 // Information from the request. |
| 398 // Content-disposition field from the header. | 403 // Content-disposition field from the header. |
| 399 std::string content_disposition_; | 404 std::string content_disposition_; |
| 400 | 405 |
| 401 // Mime-type from the header. Subject to change. | 406 // Mime-type from the header. Subject to change. |
| 402 std::string mime_type_; | 407 std::string mime_type_; |
| 403 | 408 |
| 404 // The value of the content type header sent with the downloaded item. It | 409 // The value of the content type header sent with the downloaded item. It |
| 405 // may be different from |mime_type_|, which may be set based on heuristics | 410 // may be different from |mime_type_|, which may be set based on heuristics |
| 406 // which may look at the file extension and first few bytes of the file. | 411 // which may look at the file extension and first few bytes of the file. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // only. | 482 // only. |
| 478 bool open_enabled_; | 483 bool open_enabled_; |
| 479 | 484 |
| 480 // DownloadItem observes CRX installs it initiates. | 485 // DownloadItem observes CRX installs it initiates. |
| 481 NotificationRegistrar registrar_; | 486 NotificationRegistrar registrar_; |
| 482 | 487 |
| 483 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 488 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
| 484 }; | 489 }; |
| 485 | 490 |
| 486 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 491 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
| OLD | NEW |