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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 int64 received_bytes() const { return received_bytes_; } | 252 int64 received_bytes() const { return received_bytes_; } |
253 int32 id() const { return id_; } | 253 int32 id() const { return id_; } |
254 base::Time start_time() const { return start_time_; } | 254 base::Time start_time() const { return start_time_; } |
255 void set_db_handle(int64 handle) { db_handle_ = handle; } | 255 void set_db_handle(int64 handle) { db_handle_ = handle; } |
256 int64 db_handle() const { return db_handle_; } | 256 int64 db_handle() const { return db_handle_; } |
257 bool is_paused() const { return is_paused_; } | 257 bool is_paused() const { return is_paused_; } |
258 bool open_when_complete() const { return open_when_complete_; } | 258 bool open_when_complete() const { return open_when_complete_; } |
259 void set_open_when_complete(bool open) { open_when_complete_ = open; } | 259 void set_open_when_complete(bool open) { open_when_complete_ = open; } |
260 int render_process_id() const { return render_process_id_; } | 260 int render_process_id() const { return render_process_id_; } |
261 int request_id() const { return request_id_; } | 261 int request_id() const { return request_id_; } |
262 bool is_path_exists() const { return is_path_exists_; } | |
Paweł Hajdan Jr.
2011/05/10 07:59:46
nit: is_path_exists is a bad name. Why not just fi
| |
263 void set_is_path_exists(bool is_path_exists) { | |
Paweł Hajdan Jr.
2011/05/10 07:59:46
We generally avoid raw setters like this. How abou
| |
264 is_path_exists_ = is_path_exists; | |
265 } | |
262 SafetyState safety_state() const { return safety_state_; } | 266 SafetyState safety_state() const { return safety_state_; } |
263 void set_safety_state(SafetyState safety_state) { | 267 void set_safety_state(SafetyState safety_state) { |
264 safety_state_ = safety_state; | 268 safety_state_ = safety_state; |
265 } | 269 } |
266 DangerType danger_type() { return danger_type_;} | 270 DangerType danger_type() { return danger_type_;} |
267 bool auto_opened() { return auto_opened_; } | 271 bool auto_opened() { return auto_opened_; } |
268 FilePath target_name() const { return target_name_; } | 272 FilePath target_name() const { return target_name_; } |
269 bool save_as() const { return save_as_; } | 273 bool save_as() const { return save_as_; } |
270 bool is_otr() const { return is_otr_; } | 274 bool is_otr() const { return is_otr_; } |
271 bool is_extension_install() const { return is_extension_install_; } | 275 bool is_extension_install() const { return is_extension_install_; } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 | 362 |
359 // Our owning object | 363 // Our owning object |
360 DownloadManager* download_manager_; | 364 DownloadManager* download_manager_; |
361 | 365 |
362 // In progress downloads may be paused by the user, we note it here | 366 // In progress downloads may be paused by the user, we note it here |
363 bool is_paused_; | 367 bool is_paused_; |
364 | 368 |
365 // A flag for indicating if the download should be opened at completion. | 369 // A flag for indicating if the download should be opened at completion. |
366 bool open_when_complete_; | 370 bool open_when_complete_; |
367 | 371 |
372 // A flag for indicating if the downloaded path exists or not. | |
373 bool is_path_exists_; | |
374 | |
368 // Whether the download is considered potentially safe or dangerous | 375 // Whether the download is considered potentially safe or dangerous |
369 // (executable files are typically considered dangerous). | 376 // (executable files are typically considered dangerous). |
370 SafetyState safety_state_; | 377 SafetyState safety_state_; |
371 | 378 |
372 // Why |safety_state_| is not SAFE. | 379 // Why |safety_state_| is not SAFE. |
373 DangerType danger_type_; | 380 DangerType danger_type_; |
374 | 381 |
375 // Whether the download was auto-opened. We set this rather than using | 382 // Whether the download was auto-opened. We set this rather than using |
376 // an observer as it's frequently possible for the download to be auto opened | 383 // an observer as it's frequently possible for the download to be auto opened |
377 // before the observer is added. | 384 // before the observer is added. |
(...skipping 26 matching lines...) Expand all Loading... | |
404 // Did the user open the item either directly or indirectly (such as by | 411 // Did the user open the item either directly or indirectly (such as by |
405 // setting always open files of this type)? The shelf also sets this field | 412 // setting always open files of this type)? The shelf also sets this field |
406 // when the user closes the shelf before the item has been opened but should | 413 // when the user closes the shelf before the item has been opened but should |
407 // be treated as though the user opened it. | 414 // be treated as though the user opened it. |
408 bool opened_; | 415 bool opened_; |
409 | 416 |
410 DISALLOW_COPY_AND_ASSIGN(DownloadItem); | 417 DISALLOW_COPY_AND_ASSIGN(DownloadItem); |
411 }; | 418 }; |
412 | 419 |
413 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ | 420 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ |
OLD | NEW |