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

Side by Side Diff: chrome/browser/history/download_create_info.h

Issue 6932046: Added DownloadProcessHandle class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup per Pawel's comments. Created 9 years, 7 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 // Download creation struct used for querying the history service. 5 // Download creation struct used for querying the history service.
6 6
7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ 7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ 8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
9 #pragma once 9 #pragma once
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/file_path.h" 15 #include "base/file_path.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "chrome/browser/download/download_file.h" 17 #include "chrome/browser/download/download_file.h"
18 #include "chrome/browser/download/download_process_handle.h"
18 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
19 20
20 // Used for informing the download database of a new download, where we don't 21 // Used for informing the download database of a new download, where we don't
21 // want to pass DownloadItems between threads. The history service also uses a 22 // want to pass DownloadItems between threads. The history service also uses a
22 // vector of these structs for passing us the state of all downloads at 23 // vector of these structs for passing us the state of all downloads at
23 // initialization time (see DownloadQueryInfo below). 24 // initialization time (see DownloadQueryInfo below).
24 struct DownloadCreateInfo { 25 struct DownloadCreateInfo {
25 DownloadCreateInfo(const FilePath& path, 26 DownloadCreateInfo(const FilePath& path,
26 const GURL& url, 27 const GURL& url,
27 base::Time start_time, 28 base::Time start_time,
(...skipping 22 matching lines...) Expand all
50 FilePath suggested_path; 51 FilePath suggested_path;
51 // A number that should be added to the suggested path to make it unique. 52 // A number that should be added to the suggested path to make it unique.
52 // 0 means no number should be appended. Not actually stored in the db. 53 // 0 means no number should be appended. Not actually stored in the db.
53 int path_uniquifier; 54 int path_uniquifier;
54 base::Time start_time; 55 base::Time start_time;
55 int64 received_bytes; 56 int64 received_bytes;
56 int64 total_bytes; 57 int64 total_bytes;
57 int32 state; 58 int32 state;
58 int32 download_id; 59 int32 download_id;
59 bool has_user_gesture; 60 bool has_user_gesture;
60 int child_id; 61 DownloadProcessHandle process_handle;
61 int render_view_id;
62 int request_id;
63 int64 db_handle; 62 int64 db_handle;
64 std::string content_disposition; 63 std::string content_disposition;
65 std::string mime_type; 64 std::string mime_type;
66 // The value of the content type header sent with the downloaded item. It 65 // The value of the content type header sent with the downloaded item. It
67 // may be different from |mime_type|, which may be set based on heuristics 66 // may be different from |mime_type|, which may be set based on heuristics
68 // which may look at the file extension and first few bytes of the file. 67 // which may look at the file extension and first few bytes of the file.
69 std::string original_mime_type; 68 std::string original_mime_type;
70 69
71 // True if we should display the 'save as...' UI and prompt the user 70 // True if we should display the 'save as...' UI and prompt the user
72 // for the download location. 71 // for the download location.
73 // False if the UI should be supressed and the download performed to the 72 // False if the UI should be supressed and the download performed to the
74 // default location. 73 // default location.
75 bool prompt_user_for_save_location; 74 bool prompt_user_for_save_location;
76 // Whether this download file is potentially dangerous (ex: exe, dll, ...). 75 // Whether this download file is potentially dangerous (ex: exe, dll, ...).
77 bool is_dangerous_file; 76 bool is_dangerous_file;
78 // If safebrowsing believes this URL leads to malware. 77 // If safebrowsing believes this URL leads to malware.
79 bool is_dangerous_url; 78 bool is_dangerous_url;
80 // The original name for a dangerous download. 79 // The original name for a dangerous download.
81 FilePath original_name; 80 FilePath original_name;
82 // Whether this download is for extension install or not. 81 // Whether this download is for extension install or not.
83 bool is_extension_install; 82 bool is_extension_install;
84 // The charset of the referring page where the download request comes from. 83 // The charset of the referring page where the download request comes from.
85 // It's used to construct a suggested filename. 84 // It's used to construct a suggested filename.
86 std::string referrer_charset; 85 std::string referrer_charset;
87 // The download file save info. 86 // The download file save info.
88 DownloadSaveInfo save_info; 87 DownloadSaveInfo save_info;
89 }; 88 };
90 89
91 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ 90 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698