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

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

Issue 7624031: Treat files downloaded from the address bar as "always safe" (including extensions per discussion... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "content/browser/download/download_file.h" 15 #include "content/browser/download/download_file.h"
16 #include "content/browser/download/download_request_handle.h" 16 #include "content/browser/download/download_request_handle.h"
17 #include "content/common/page_transition_types.h"
17 #include "googleurl/src/gurl.h" 18 #include "googleurl/src/gurl.h"
18 19
19 // Used for informing the download manager of a new download, since we don't 20 // Used for informing the download manager of a new download, since we don't
20 // want to pass |DownloadItem|s between threads. 21 // want to pass |DownloadItem|s between threads.
21 struct DownloadCreateInfo { 22 struct DownloadCreateInfo {
22 DownloadCreateInfo(const FilePath& path, 23 DownloadCreateInfo(const FilePath& path,
23 const GURL& url, 24 const GURL& url,
24 const base::Time& start_time, 25 const base::Time& start_time,
25 int64 received_bytes, 26 int64 received_bytes,
26 int64 total_bytes, 27 int64 total_bytes,
27 int32 state, 28 int32 state,
28 int32 download_id, 29 int32 download_id,
29 bool has_user_gesture); 30 bool has_user_gesture,
31 PageTransition::Type transition_type);
30 DownloadCreateInfo(); 32 DownloadCreateInfo();
31 ~DownloadCreateInfo(); 33 ~DownloadCreateInfo();
32 34
33 std::string DebugString() const; 35 std::string DebugString() const;
34 36
35 // The URL from which we are downloading. This is the final URL after any 37 // The URL from which we are downloading. This is the final URL after any
36 // redirection by the server for |url_chain|. 38 // redirection by the server for |url_chain|.
37 const GURL& url() const; 39 const GURL& url() const;
38 40
39 // DownloadItem fields 41 // DownloadItem fields
(...skipping 21 matching lines...) Expand all
61 63
62 // The current state of the download. 64 // The current state of the download.
63 int32 state; 65 int32 state;
64 66
65 // The (per-session) ID of the download. 67 // The (per-session) ID of the download.
66 int32 download_id; 68 int32 download_id;
67 69
68 // True if the download was initiated by user action. 70 // True if the download was initiated by user action.
69 bool has_user_gesture; 71 bool has_user_gesture;
70 72
73 PageTransition::Type transition_type;
74
71 // The handle to the download request information. Used for operations 75 // The handle to the download request information. Used for operations
72 // outside the download system. 76 // outside the download system.
73 DownloadRequestHandle request_handle; 77 DownloadRequestHandle request_handle;
74 78
75 // The handle of the download in the history database. 79 // The handle of the download in the history database.
76 int64 db_handle; 80 int64 db_handle;
77 81
78 // The content-disposition string from the response header. 82 // The content-disposition string from the response header.
79 std::string content_disposition; 83 std::string content_disposition;
80 84
(...skipping 16 matching lines...) Expand all
97 101
98 // The charset of the referring page where the download request comes from. 102 // The charset of the referring page where the download request comes from.
99 // It's used to construct a suggested filename. 103 // It's used to construct a suggested filename.
100 std::string referrer_charset; 104 std::string referrer_charset;
101 105
102 // The download file save info. 106 // The download file save info.
103 DownloadSaveInfo save_info; 107 DownloadSaveInfo save_info;
104 }; 108 };
105 109
106 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 110 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.clear.html ('k') | content/browser/download/download_create_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698