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

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

Issue 219017: Create the download folder if it doesn't exist. That is, the actual download ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unit tests Created 11 years, 2 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
« no previous file with comments | « chrome/browser/download/save_file_manager.cc ('k') | chrome/browser/download/save_package.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Accessor 124 // Accessor
125 bool finished() { return finished_; } 125 bool finished() { return finished_; }
126 SavePackageType save_type() { return save_type_; } 126 SavePackageType save_type() { return save_type_; }
127 127
128 // Since for one tab, it can only have one SavePackage in same time. 128 // Since for one tab, it can only have one SavePackage in same time.
129 // Now we actually use render_process_id as tab's unique id. 129 // Now we actually use render_process_id as tab's unique id.
130 int tab_id() const { return tab_id_; } 130 int tab_id() const { return tab_id_; }
131 131
132 void GetSaveInfo(); 132 void GetSaveInfo();
133 void ContinueGetSaveInfo(FilePath save_dir);
133 void ContinueSave(SavePackageParam* param, 134 void ContinueSave(SavePackageParam* param,
134 const FilePath& final_name, 135 const FilePath& final_name,
135 int index); 136 int index);
136 137
137 // RenderViewHostDelegate::Save ---------------------------------------------- 138 // RenderViewHostDelegate::Save ----------------------------------------------
138 139
139 // Process all of the current page's savable links of subresources, resources 140 // Process all of the current page's savable links of subresources, resources
140 // referrers and frames (including the main frame and subframes) from the 141 // referrers and frames (including the main frame and subframes) from the
141 // render view host. 142 // render view host.
142 virtual void OnReceivedSavableResourceLinksForCurrentPage( 143 virtual void OnReceivedSavableResourceLinksForCurrentPage(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 193
193 // SelectFileDialog::Listener interface. 194 // SelectFileDialog::Listener interface.
194 virtual void FileSelected(const FilePath& path, int index, void* params); 195 virtual void FileSelected(const FilePath& path, int index, void* params);
195 virtual void FileSelectionCanceled(void* params); 196 virtual void FileSelectionCanceled(void* params);
196 197
197 private: 198 private:
198 // For testing only. 199 // For testing only.
199 SavePackage(const FilePath& file_full_path, 200 SavePackage(const FilePath& file_full_path,
200 const FilePath& directory_full_path); 201 const FilePath& directory_full_path);
201 202
203 // Notes from Init() above applies here as well.
204 void InternalInit();
205
202 void Stop(); 206 void Stop();
203 void CheckFinish(); 207 void CheckFinish();
204 void SaveNextFile(bool process_all_remainder_items); 208 void SaveNextFile(bool process_all_remainder_items);
205 void DoSavingProcess(); 209 void DoSavingProcess();
206 210
207 // Create a file name based on the response from the server. 211 // Create a file name based on the response from the server.
208 bool GenerateFilename(const std::string& disposition, 212 bool GenerateFilename(const std::string& disposition,
209 const GURL& url, 213 const GURL& url,
210 bool need_html_ext, 214 bool need_html_ext,
211 FilePath::StringType* generated_name); 215 FilePath::StringType* generated_name);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 312
309 // For managing select file dialogs. 313 // For managing select file dialogs.
310 scoped_refptr<SelectFileDialog> select_file_dialog_; 314 scoped_refptr<SelectFileDialog> select_file_dialog_;
311 315
312 friend class SavePackageTest; 316 friend class SavePackageTest;
313 317
314 DISALLOW_COPY_AND_ASSIGN(SavePackage); 318 DISALLOW_COPY_AND_ASSIGN(SavePackage);
315 }; 319 };
316 320
317 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 321 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/save_file_manager.cc ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698