Mark GData downloads as temporary.
This patch does the following:
1. Allow DownloadItems to transition to temporary downloads after they are created.
2. Prevent temporary downloads from affecting the last download directory. The last download directory is used as the default for subsequent "Save as" downloads.
3. Disable "Open when complete" and "Always open files of this type" for temporary downloads.
4. Mark GData downloads as temporary.
BUG=none
TEST=GData downloads don't show up in history and are removed automatically from the shelf
Review URL: http://codereview.chromium.org/9796010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128682 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index f6d16f7..33b32d88 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -904,7 +904,9 @@
VLOG(20) << __FUNCTION__ << "()" << " path = \"" << path.value() << "\""
<< " download = " << download->DebugString(true);
- if (download->PromptUserForSaveLocation())
+ // Retain the last directory that was picked by the user. Exclude temporary
+ // downloads since the path likely points at the location of a temporary file.
+ if (download->PromptUserForSaveLocation() && !download->IsTemporary())
last_download_path_ = path.DirName();
// Make sure the initial file name is set only once.