Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: content/browser/download/download_item.h

Issue 8468020: Propagate the SafeBrowsing download protection verdict to the DownloadItem. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add missing file and fix some unit-tests Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // This enum is used by histograms. Do not change the ordering or remove 78 // This enum is used by histograms. Do not change the ordering or remove
79 // items. 79 // items.
80 enum DangerType { 80 enum DangerType {
81 NOT_DANGEROUS = 0, 81 NOT_DANGEROUS = 0,
82 82
83 // A dangerous file to the system (e.g.: an executable or extension from 83 // A dangerous file to the system (e.g.: an executable or extension from
84 // places other than gallery). 84 // places other than gallery).
85 DANGEROUS_FILE, 85 DANGEROUS_FILE,
86 86
87 // Safebrowsing service shows this URL leads to malicious file download. 87 // Safebrowsing download service shows this URL leads to malicious file
88 // download.
88 DANGEROUS_URL, 89 DANGEROUS_URL,
89 90
91 // SafeBrowsing download service shows this file content as being malicious.
92 DANGEROUS_CONTENT,
asanka 2011/11/16 03:23:48 Note that this should also be updated in download_
noelutz 2011/11/16 03:50:26 Done.
93
90 // Memory space for histograms is determined by the max. 94 // Memory space for histograms is determined by the max.
91 // ALWAYS ADD NEW VALUES BEFORE THIS ONE. 95 // ALWAYS ADD NEW VALUES BEFORE THIS ONE.
92 DANGEROUS_TYPE_MAX 96 DANGEROUS_TYPE_MAX
93 }; 97 };
94 98
95 // Reason for deleting the download. Passed to Delete(). 99 // Reason for deleting the download. Passed to Delete().
96 enum DeleteReason { 100 enum DeleteReason {
97 DELETE_DUE_TO_BROWSER_SHUTDOWN = 0, 101 DELETE_DUE_TO_BROWSER_SHUTDOWN = 0,
98 DELETE_DUE_TO_USER_DISCARD 102 DELETE_DUE_TO_USER_DISCARD
99 }; 103 };
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 bool is_paused() const { return is_paused_; } 298 bool is_paused() const { return is_paused_; }
295 bool open_when_complete() const { return open_when_complete_; } 299 bool open_when_complete() const { return open_when_complete_; }
296 void set_open_when_complete(bool open) { open_when_complete_ = open; } 300 void set_open_when_complete(bool open) { open_when_complete_ = open; }
297 bool file_externally_removed() const { return file_externally_removed_; } 301 bool file_externally_removed() const { return file_externally_removed_; }
298 SafetyState safety_state() const { return safety_state_; } 302 SafetyState safety_state() const { return safety_state_; }
299 // Why |safety_state_| is not SAFE. 303 // Why |safety_state_| is not SAFE.
300 DangerType GetDangerType() const; 304 DangerType GetDangerType() const;
301 bool IsDangerous() const; 305 bool IsDangerous() const;
302 void MarkFileDangerous(); 306 void MarkFileDangerous();
303 void MarkUrlDangerous(); 307 void MarkUrlDangerous();
308 void MarkContentDangerous();
304 309
305 bool auto_opened() { return auto_opened_; } 310 bool auto_opened() { return auto_opened_; }
306 const FilePath& target_name() const { return state_info_.target_name; } 311 const FilePath& target_name() const { return state_info_.target_name; }
307 bool prompt_user_for_save_location() const { 312 bool prompt_user_for_save_location() const {
308 return state_info_.prompt_user_for_save_location; 313 return state_info_.prompt_user_for_save_location;
309 } 314 }
315 bool needs_quarantine_file() { return state_info_.needs_quarantine_file; }
310 bool is_otr() const { return is_otr_; } 316 bool is_otr() const { return is_otr_; }
311 const FilePath& suggested_path() const { return state_info_.suggested_path; } 317 const FilePath& suggested_path() const { return state_info_.suggested_path; }
312 bool is_temporary() const { return is_temporary_; } 318 bool is_temporary() const { return is_temporary_; }
313 void set_opened(bool opened) { opened_ = opened; } 319 void set_opened(bool opened) { opened_ = opened; }
314 bool opened() const { return opened_; } 320 bool opened() const { return opened_; }
315 321
316 InterruptReason last_reason() const { return last_reason_; } 322 InterruptReason last_reason() const { return last_reason_; }
317 323
318 DownloadPersistentStoreInfo GetPersistentStoreInfo() const; 324 DownloadPersistentStoreInfo GetPersistentStoreInfo() const;
319 DownloadStateInfo state_info() const { return state_info_; } 325 DownloadStateInfo state_info() const { return state_info_; }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // only. 495 // only.
490 bool open_enabled_; 496 bool open_enabled_;
491 497
492 // Did the delegate delay calling Complete on this download? 498 // Did the delegate delay calling Complete on this download?
493 bool delegate_delayed_complete_; 499 bool delegate_delayed_complete_;
494 500
495 DISALLOW_COPY_AND_ASSIGN(DownloadItem); 501 DISALLOW_COPY_AND_ASSIGN(DownloadItem);
496 }; 502 };
497 503
498 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_ 504 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698