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

Side by Side Diff: chrome/browser/download/download_util.h

Issue 2805091: Download code cleanup: (Closed)
Patch Set: rebased Created 10 years, 5 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
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 utilities. 5 // Download utilities.
6 6
7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
9 9
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "gfx/native_widget_types.h" 14 #include "gfx/native_widget_types.h"
15 15
16 #if defined(TOOLKIT_VIEWS) 16 #if defined(TOOLKIT_VIEWS)
17 #include "views/view.h" 17 #include "views/view.h"
18 #endif 18 #endif
19 19
20 namespace gfx { 20 namespace gfx {
21 class Canvas; 21 class Canvas;
22 } 22 }
23 23
24 class BaseDownloadItemModel; 24 class BaseDownloadItemModel;
25 class DictionaryValue; 25 class DictionaryValue;
26 class DownloadItem; 26 class DownloadItem;
27 class FilePath; 27 class FilePath;
28 class GURL;
29 class ResourceDispatcherHost;
28 class SkBitmap; 30 class SkBitmap;
31 class URLRequestContextGetter;
32
33 struct DownloadSaveInfo;
29 34
30 namespace download_util { 35 namespace download_util {
31 36
32 // Download opening ------------------------------------------------------------ 37 // Download opening ------------------------------------------------------------
33 38
34 // Whether it is OK to open this download. 39 // Whether it is OK to open this download.
35 bool CanOpenDownload(DownloadItem* download); 40 bool CanOpenDownload(DownloadItem* download);
36 41
37 // Open the file associated with this download (wait for the download to 42 // Open the file associated with this download (wait for the download to
38 // complete if it is in progress). 43 // complete if it is in progress).
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 155
151 // Appends the passed the number between parenthesis the path before the 156 // Appends the passed the number between parenthesis the path before the
152 // extension. 157 // extension.
153 void AppendNumberToPath(FilePath* path, int number); 158 void AppendNumberToPath(FilePath* path, int number);
154 159
155 // Attempts to find a number that can be appended to that path to make it 160 // Attempts to find a number that can be appended to that path to make it
156 // unique. If |path| does not exist, 0 is returned. If it fails to find such 161 // unique. If |path| does not exist, 0 is returned. If it fails to find such
157 // a number, -1 is returned. 162 // a number, -1 is returned.
158 int GetUniquePathNumber(const FilePath& path); 163 int GetUniquePathNumber(const FilePath& path);
159 164
165 // Download the URL. Must be called on the IO thread.
166 void DownloadUrl(const GURL& url,
167 const GURL& referrer,
168 const std::string& referrer_charset,
169 const DownloadSaveInfo& save_info,
170 ResourceDispatcherHost* rdh,
171 int render_process_host_id,
172 int render_view_id,
173 URLRequestContextGetter* request_context_getter);
174
175 // Tells the resource dispatcher host to cancel a download request.
176 // Must be called on the IO thread.
177 void CancelDownloadRequest(ResourceDispatcherHost* rdh,
178 int render_process_id,
179 int request_id);
180
181
160 } // namespace download_util 182 } // namespace download_util
161 183
162 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ 184 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698