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

Unified Diff: content/browser/tab_contents/tab_contents.h

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: Applied Pawel's comments Created 9 years, 4 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
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.h
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 3f416e4ac8723dc76ba93ced2dff7ce573a3ee84..9a154337b438379a4718a443ae917b8f91ac9c56 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -400,6 +400,9 @@ class TabContents : public PageNavigator,
// Save page with the main HTML file path, the directory for saving resources,
// and the save type: HTML only or complete web page. Returns true if the
// saving process has been initiated successfully.
+ // This method is used in automated testing to bypass prompting the user for
+ // file names. Instead, the names and paths are hard coded rather than
+ // running them through file name sanitation and extension / mime checking.
bool SavePage(const FilePath& main_file, const FilePath& dir_path,
SavePackage::SavePackageType save_type);
@@ -522,6 +525,9 @@ class TabContents : public PageNavigator,
FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles);
FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate);
FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload);
+ FRIEND_TEST_ALL_PREFIXES(SavePageBrowserTest, SaveFolder1);
+ FRIEND_TEST_ALL_PREFIXES(SavePageBrowserTest, SaveFolder2);
+ FRIEND_TEST_ALL_PREFIXES(SavePageBrowserTest, SaveFolder3);
// Temporary until the view/contents separation is complete.
friend class TabContentsView;
@@ -533,6 +539,16 @@ class TabContents : public PageNavigator,
friend class TabContentsViewGtk;
#endif
+ // Used in automated testing to bypass prompting the user for file names.
+ // The difference between SavePageBasedOnDefaultPrefs() and SavePage()
+ // is whether the default folder prefs are used. In case of SavePage(),
+ // we need to give it the file path to which the file is saved.
+ // On the other hand, in case of SavePageBasedOnDefaultPrefs(),
+ // we need not to give the file path since the file path is determined
+ // based on the default folder prefs. This method returns the title
+ // of the current tab.
+ string16 SavePageBasedOnDefaultPrefs();
+
// So InterstitialPage can access SetIsLoading.
friend class InterstitialPage;
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698