| 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 37 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 38 content::DownloadId download_id, | 38 content::DownloadId download_id, |
| 39 const content::DownloadPersistentStoreInfo& info, | 39 const content::DownloadPersistentStoreInfo& info, |
| 40 const net::BoundNetLog& bound_net_log); | 40 const net::BoundNetLog& bound_net_log); |
| 41 | 41 |
| 42 // Constructing for a regular download. | 42 // Constructing for a regular download. |
| 43 // |bound_net_log| is constructed externally for our use. | 43 // |bound_net_log| is constructed externally for our use. |
| 44 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 44 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 45 const DownloadCreateInfo& info, | 45 const DownloadCreateInfo& info, |
| 46 scoped_ptr<DownloadRequestHandleInterface> request_handle, | 46 scoped_ptr<DownloadRequestHandleInterface> request_handle, |
| 47 bool is_otr, | |
| 48 const net::BoundNetLog& bound_net_log); | 47 const net::BoundNetLog& bound_net_log); |
| 49 | 48 |
| 50 // Constructing for the "Save Page As..." feature: | 49 // Constructing for the "Save Page As..." feature: |
| 51 // |bound_net_log| is constructed externally for our use. | 50 // |bound_net_log| is constructed externally for our use. |
| 52 DownloadItemImpl(DownloadItemImplDelegate* delegate, | 51 DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 53 const FilePath& path, | 52 const FilePath& path, |
| 54 const GURL& url, | 53 const GURL& url, |
| 55 bool is_otr, | |
| 56 content::DownloadId download_id, | 54 content::DownloadId download_id, |
| 57 const std::string& mime_type, | 55 const std::string& mime_type, |
| 58 const net::BoundNetLog& bound_net_log); | 56 const net::BoundNetLog& bound_net_log); |
| 59 | 57 |
| 60 virtual ~DownloadItemImpl(); | 58 virtual ~DownloadItemImpl(); |
| 61 | 59 |
| 62 // Implementation functions (not part of the DownloadItem interface). | 60 // Implementation functions (not part of the DownloadItem interface). |
| 63 | 61 |
| 64 // Called when the target path has been determined. |target_path| is the | 62 // Called when the target path has been determined. |target_path| is the |
| 65 // suggested target path. |disposition| indicates how the target path should | 63 // suggested target path. |disposition| indicates how the target path should |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 virtual void SetOpenWhenComplete(bool open) OVERRIDE; | 169 virtual void SetOpenWhenComplete(bool open) OVERRIDE; |
| 172 virtual bool GetFileExternallyRemoved() const OVERRIDE; | 170 virtual bool GetFileExternallyRemoved() const OVERRIDE; |
| 173 virtual SafetyState GetSafetyState() const OVERRIDE; | 171 virtual SafetyState GetSafetyState() const OVERRIDE; |
| 174 virtual content::DownloadDangerType GetDangerType() const OVERRIDE; | 172 virtual content::DownloadDangerType GetDangerType() const OVERRIDE; |
| 175 virtual bool IsDangerous() const OVERRIDE; | 173 virtual bool IsDangerous() const OVERRIDE; |
| 176 virtual bool GetAutoOpened() OVERRIDE; | 174 virtual bool GetAutoOpened() OVERRIDE; |
| 177 virtual FilePath GetTargetName() const OVERRIDE; | 175 virtual FilePath GetTargetName() const OVERRIDE; |
| 178 virtual const FilePath& GetForcedFilePath() const OVERRIDE; | 176 virtual const FilePath& GetForcedFilePath() const OVERRIDE; |
| 179 virtual bool HasUserGesture() const OVERRIDE; | 177 virtual bool HasUserGesture() const OVERRIDE; |
| 180 virtual content::PageTransition GetTransitionType() const OVERRIDE; | 178 virtual content::PageTransition GetTransitionType() const OVERRIDE; |
| 181 virtual bool IsOtr() const OVERRIDE; | |
| 182 virtual bool IsTemporary() const OVERRIDE; | 179 virtual bool IsTemporary() const OVERRIDE; |
| 183 virtual void SetIsTemporary(bool temporary) OVERRIDE; | 180 virtual void SetIsTemporary(bool temporary) OVERRIDE; |
| 184 virtual void SetOpened(bool opened) OVERRIDE; | 181 virtual void SetOpened(bool opened) OVERRIDE; |
| 185 virtual bool GetOpened() const OVERRIDE; | 182 virtual bool GetOpened() const OVERRIDE; |
| 186 virtual const std::string& GetLastModifiedTime() const OVERRIDE; | 183 virtual const std::string& GetLastModifiedTime() const OVERRIDE; |
| 187 virtual const std::string& GetETag() const OVERRIDE; | 184 virtual const std::string& GetETag() const OVERRIDE; |
| 188 virtual content::DownloadInterruptReason GetLastReason() const OVERRIDE; | 185 virtual content::DownloadInterruptReason GetLastReason() const OVERRIDE; |
| 189 virtual content::DownloadPersistentStoreInfo | 186 virtual content::DownloadPersistentStoreInfo |
| 190 GetPersistentStoreInfo() const OVERRIDE; | 187 GetPersistentStoreInfo() const OVERRIDE; |
| 191 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 188 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // (executable files are typically considered dangerous). | 373 // (executable files are typically considered dangerous). |
| 377 SafetyState safety_state_; | 374 SafetyState safety_state_; |
| 378 | 375 |
| 379 // True if the download was auto-opened. We set this rather than using | 376 // True if the download was auto-opened. We set this rather than using |
| 380 // an observer as it's frequently possible for the download to be auto opened | 377 // an observer as it's frequently possible for the download to be auto opened |
| 381 // before the observer is added. | 378 // before the observer is added. |
| 382 bool auto_opened_; | 379 bool auto_opened_; |
| 383 | 380 |
| 384 bool is_persisted_; | 381 bool is_persisted_; |
| 385 | 382 |
| 386 // True if the download was initiated in an incognito window. | |
| 387 bool is_otr_; | |
| 388 | |
| 389 // True if the item was downloaded temporarily. | 383 // True if the item was downloaded temporarily. |
| 390 bool is_temporary_; | 384 bool is_temporary_; |
| 391 | 385 |
| 392 // True if we've saved all the data for the download. | 386 // True if we've saved all the data for the download. |
| 393 bool all_data_saved_; | 387 bool all_data_saved_; |
| 394 | 388 |
| 395 // Did the user open the item either directly or indirectly (such as by | 389 // Did the user open the item either directly or indirectly (such as by |
| 396 // setting always open files of this type)? The shelf also sets this field | 390 // setting always open files of this type)? The shelf also sets this field |
| 397 // when the user closes the shelf before the item has been opened but should | 391 // when the user closes the shelf before the item has been opened but should |
| 398 // be treated as though the user opened it. | 392 // be treated as though the user opened it. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 410 | 404 |
| 411 // Net log to use for this download. | 405 // Net log to use for this download. |
| 412 const net::BoundNetLog bound_net_log_; | 406 const net::BoundNetLog bound_net_log_; |
| 413 | 407 |
| 414 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 408 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| 415 | 409 |
| 416 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 410 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
| 417 }; | 411 }; |
| 418 | 412 |
| 419 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 413 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| OLD | NEW |