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

Unified Diff: chrome/browser/ui/download/download_tab_helper.cc

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct typo 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/download/download_tab_helper.cc
diff --git a/chrome/browser/ui/download/download_tab_helper.cc b/chrome/browser/ui/download/download_tab_helper.cc
index 54a95de7cb309ef8540421f3420cc00d67d88237..cb674e5ac179abfa827849b9e832e19ae82a7030 100644
--- a/chrome/browser/ui/download/download_tab_helper.cc
+++ b/chrome/browser/ui/download/download_tab_helper.cc
@@ -68,6 +68,19 @@ bool DownloadTabHelper::SavePage(const FilePath& main_file,
return save_package_->Init();
}
+// Used in automated testing to check the folder where an HTML is saved.
+string16 DownloadTabHelper::SavePageToProperDirectory(
+ const FilePath& website_save_dir,
+ const FilePath& download_save_dir,
+ SavePackage::SavePackageType save_type) {
+ tab_contents()->Stop();
+
+ save_package_ = new SavePackage(tab_contents_wrapper_);
+ save_package_->SetShouldPromptUser(false);
+ save_package_->GetSaveInfo(website_save_dir, download_save_dir, save_type);
+ return tab_contents()->GetTitle();
+}
+
bool DownloadTabHelper::CanDownload(int request_id) {
if (delegate_)
return delegate_->CanDownload(request_id);

Powered by Google App Engine
This is Rietveld 408576698