summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_manager_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* New cancel test (includes change in DownloadItem::Complete meaning andrdsmith@chromium.org2011-04-191-12/+1
| | | | | | | | | | | | | | | | | notification interface). * Changed DownloadItem::COMPLETE state to mean "really all done" with download (used to mean "all data received"). This isn't a very large change, since we recently put in another change to dangerous downloads where we didn't recognize all data received until we had been accepted by the user, which means that there aren't any blocking points between all data received and COMPLETE. * Removed DownloadItem::Observer::OnDownloadFileCompleted() notification. It's now redundant with the COMPLETE state, and the COMPLETE state works better for synchronization (because you can test the download item for it as opposed to having to be an observer when the notification is sent). * Added a basic test for cancel functionality in the downloads system. Also shifted MarkAsComplete to be used only by SavePackage, and make sure that the final transition occurs for drag-n-drop downloads (which don't need to go through name finalization). BUG=78183 TEST=All known download tests, manual drag-and-drop and dangerous accept/discard pre/post data received. Review URL: http://codereview.chromium.org/6720061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82113 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed bug where Chrome wouldn't let the user overwrite a download file.ahendrickson@chromium.org2011-04-131-0/+86
| | | | | | | | | | | | | In an ideal world, we would do the unifiquation on both the safe and dangerous download paths at the same place. Until that refactor occurs, however, we'll have to pass in a flag to distinguish them in DownloadFileManager::RenameFinishedDownloadFile(). BUG=78551 TEST=Overwrite a safe file while downloading. It should be overwritten rather than uniquified with a number. Passes DownloadManagerTest.DownloadOverwriteTest. Review URL: http://codereview.chromium.org/6824056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81413 0039d316-1c4b-4281-b951-d872f2087c98
* Cleaned up memory leak in Download Manager unit tests.ahendrickson@chromium.org2011-04-071-2/+2
| | | | | | | | | BUG=None TEST=Download manager unit tests no longer leak in Valgrind. Review URL: http://codereview.chromium.org/6815015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80845 0039d316-1c4b-4281-b951-d872f2087c98
* Detect download errors.ahendrickson@chromium.org2011-04-071-20/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | When a download error occurs, we now mark it as "Interrupted", and display the new status on the Download Shelf. This is handled through the OnResponseCompleted() method, from: DownloadResourceHandler -> DownloadFileManager -> DownloadManager The latter checks the error value, and if not zero calls DownloadError(). DownloadError() marks the download as interrupted (stopping the progress timer), updates the download history, and updates its Observers. DownloadItem::DownloadState now has a new state, INTERRUPTED. There are also new display strings that show up on interrupted downloads in the download shelf and download page. BUG=35278 TEST=Pass unit and browser tests. Also, run a python server that behaves as described below, connect to it, and observe that "Interrupted" shows up in the item on the download shelf. Check that the item behaves as if it were cancelled. The Python server should respond to a GET request with a content length that is large, then provide several chunks of data (but less than the specified length) and then send a 'No file' response (code 204) and close the connection. Review URL: http://codereview.chromium.org/6613024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80803 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Removed DownloadManagerTest.StartDownload from ChromeOS.ahendrickson@chromium.org2011-03-241-0/+4
| | | | | | | | | | | TBR: rdsmith BUG=None TEST=DownloadManagerTest.StartDownload no longer runs on ChromeOS buildbots. Review URL: http://codereview.chromium.org/6676129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79335 0039d316-1c4b-4281-b951-d872f2087c98
* Merging the safe and dangerous download paths.ahendrickson@chromium.org2011-03-241-34/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manual testing matrix: +--------------------------------------+------+-------+-------------+-------------+ | |Accept/Decline| Cancelled | | | Test |Before| After |Before|After | Completed | | |Full download |Full download| | +--------------------------------------+------+-------+-------------+-------------+ |Drag & Drop | N/A | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Safe | N/A | | | Y | +--------------------------------------+------+-------+-------------+-------------+ |Safe | N/A | Y | N/A | | +--------------------------------------+------+-------+-------------+-------------+ |Safe with uniquification | N/A | | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Safe with uniquification | N/A | Y | N/A | | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Accepted | Y | | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Accepted | | Y | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Accepted with uniquification| Y | | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Accepted with uniquification| | Y | N/A | Y | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Declined | Y | | N/A | N/A | +--------------------------------------+------+-------+-------------+-------------+ |Dangerous Declined | | Y | N/A | N/A | +--------------------------------------+------+-------+-------------+-------------+ I couldn't figure out how to get Drag & Drop to work in Windows. All I got was a URL shortcut when I tried. BUG=49394, 49568, 75277 TEST=Passes all download tests. Passes all tests in the above matrix. Review URL: http://codereview.chromium.org/6588020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79313 0039d316-1c4b-4281-b951-d872f2087c98
* Check the download file's hash against safebrowsing database. Report the ↵lzheng@chromium.org2011-03-091-2/+2
| | | | | | | | | | | malware hit when needed. TEST=safe_browsing tests stay green. BUG=60822 Review URL: http://codereview.chromium.org/6611005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77382 0039d316-1c4b-4281-b951-d872f2087c98
* Don't try to convert text/html URLs ending in .user.js.aa@chromium.org2011-03-051-2/+2
| | | | | | | | | | | | This doesn't solve the problem with view-source://, that is a separate issue. BUG=35795 TEST=manual, see bug. Review URL: http://codereview.chromium.org/6574033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77020 0039d316-1c4b-4281-b951-d872f2087c98
* Update a bunch of files to the new location of browser_thread.h jam@chromium.org2011-03-011-1/+1
| | | | | | | | TBR=avi Review URL: http://codereview.chromium.org/6594084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76411 0039d316-1c4b-4281-b951-d872f2087c98
* Enable url check in download_manager, with a simple UI (it may need polish). ↵lzheng@chromium.org2011-02-261-16/+36
| | | | | | | | | | | | The whole thing is still behind a flag. The download_file_manager will start a url check with safebrowsing. It goes parallel with file creation operation. When url is checked to be dangerous, the UI dialog will show the dialog. TEST=download_manager_unittest BUG=60822 Review URL: http://codereview.chromium.org/6410050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76123 0039d316-1c4b-4281-b951-d872f2087c98
* DownloadFile no longer keeps track of whether or not the final rename has ↵ahendrickson@chromium.org2011-02-181-11/+9
| | | | | | | | | | | | | | | occurred. Instead, DownloadFileManager puts the DownloadFile in a new map when it has the final name. This is a step towards moving the 'final rename' determination happen in the UI thread. BUG=None TEST=None Review URL: http://codereview.chromium.org/6480079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75400 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring DownloadFile.ahendrickson@chromium.org2011-02-151-9/+0
| | | | | | | | | | | Removed dead code (DeleteCrDownload method), and unnecessary parameter. BUG=None TEST=DownloadFile unit tests still pass. Review URL: http://codereview.chromium.org/6485008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74949 0039d316-1c4b-4281-b951-d872f2087c98
* Added DownloadFile unit tests.ahendrickson@chromium.org2011-02-021-12/+2
| | | | | | | | | BUG=None TEST=Unit tests pass. Review URL: http://codereview.chromium.org/6312037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73507 0039d316-1c4b-4281-b951-d872f2087c98
* Put history insertion for downloads processing inline.rdsmith@chromium.org2011-01-231-7/+8
| | | | | | | | | | | | | | | | | | | This change shifts standard download processing to wait on history insertion (note that actual data download does not wait). This makes the download process less racy and is expected to make the download tests less flaky. Note that it also brings the rename to the download intermediate file rename inline into standard download processing; i.e. now we always rename to the intermediate file name and then to the final file name. This again reduces raciness and possibly tset flakiness. BUG=63237 TEST=All current download tests. Review URL: http://codereview.chromium.org/6096003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72301 0039d316-1c4b-4281-b951-d872f2087c98
* Internationalize the prefix of unconfirmed download file.tfarina@chromium.org2011-01-211-2/+2
| | | | | | | | | BUG=3563 TEST=manual Review URL: http://codereview.chromium.org/6247015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72204 0039d316-1c4b-4281-b951-d872f2087c98
* Enable "Always Open Files of This Type" even for dangerous file types. Thecevans@chromium.org2011-01-081-1/+6
| | | | | | | | | | | | advanced user knows what they were doing, and dangerous file types will still go through the warning dialog depending on user gesture level. BUG=65895 TEST=download_manager_unittest.cc Review URL: http://codereview.chromium.org/6196001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70853 0039d316-1c4b-4281-b951-d872f2087c98
* Create the DownloadItem earlier in the download process.ahendrickson@chromium.org2010-12-231-0/+2
| | | | | | | | | | | Since DownloadItem is now created before we analyze the file to determine its characteristics and final name/location, I have added a function SetFileCheckResults() to update DownloadItem after this process has been done. BUG=None TEST=None Review URL: http://codereview.chromium.org/5738007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70096 0039d316-1c4b-4281-b951-d872f2087c98
* Modified the file extension filters for downloads to add some extensions to ↵cdn@chromium.org2010-10-201-2/+2
| | | | | | | | | | a default list for all platforms. Also added a few previously overlooked extensions for various platforms. BUG=59817 TEST=None Review URL: http://codereview.chromium.org/3899002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63158 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ChromeThread to BrowserThread Part18:tfarina@chromium.org2010-10-111-1/+1
| | | | | | | | | | | | - Include browser_thread.h instead of chrome_thread.h in files under dom_ui and download. BUG=56926 TEST=trybots Review URL: http://codereview.chromium.org/3700002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62206 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ChromeThread to BrowserThread Part10:tfarina@chromium.org2010-10-091-3/+3
| | | | | | | | | | | - Rename entries under download and extensions. BUG=56926 TEST=trybots Review URL: http://codereview.chromium.org/3685001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62081 0039d316-1c4b-4281-b951-d872f2087c98
* Fix DCHECK assertion failures in DownloadStatusUpdater.phajdan.jr@chromium.org2010-10-061-2/+5
| | | | | | | | | | | | They indicate real problems, including possible NULL pointer dereferences. BUG=57577 TEST=none Review URL: http://codereview.chromium.org/3519005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61634 0039d316-1c4b-4281-b951-d872f2087c98
* Create DownloadStatusUpdater to keep track of download progressphajdan.jr@chromium.org2010-09-271-1/+3
| | | | | | | | | | | | | | | and update the application icon. We can't do that in DownloadManager because there are multiple DownloadManagers (one per Profile) and they would overwrite each other's updates. BUG=none TEST=none Review URL: http://codereview.chromium.org/3454018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60625 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Move ctors/dtors into cc files.erg@google.com2010-09-131-1/+1
| | | | | | | | | | | | | This cleanup patch isn't as impactful; this only shrinks our .a files by 304k. This patch also renames chrome/browser/history/download_type.h to download_create_info.h because there are then two download_type.cc files and MSVS will have the .obj from one of those overwrite the other. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3351005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59264 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: download cleanup, rename things to be more accurate.phajdan.jr@chromium.org2010-09-101-2/+2
| | | | | | | | | | | Also, moved some code closer to the object it's operating on. BUG=48913 TEST=unit_tests, ui_tests, browser_tests Review URL: http://codereview.chromium.org/3341013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59156 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Clean up DownloadFileManagerphajdan.jr@chromium.org2010-09-101-1/+2
| | | | | | | | | | | | | | | | | | | | | This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. Hopefully, this is http://codereview.chromium.org/3245005 done right. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3347018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59139 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 58196 - GTTF: Clean up DownloadFileManagerphajdan.jr@chromium.org2010-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3245005 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3348010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58718 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Clean up DownloadFileManagerphajdan.jr@chromium.org2010-09-011-1/+1
| | | | | | | | | | | | | | | | | | | This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3245005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58196 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting to see if this fixes linux ui tests hang. Just a shot in the dark ↵ananta@chromium.org2010-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | at this point. Revert 58087 - GTTF: Clean up DownloadFileManager This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3245005 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3311001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58119 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Clean up DownloadFileManagerphajdan.jr@chromium.org2010-08-311-1/+1
| | | | | | | | | | | | | | | | | | | This removes a lot of duplication, locking, and thread jumping. Most of the operations run on the FILE thread, and we do not duplicate so much information. Each DownloadFile keeps track of its DownloadManager (each Profile has its own DownloadManager). This allows us to remove many maps from DownloadFileManager that were duplicating that information. There is still SaveFileManager, but hopefully I will be able to merge those two in small steps. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3245005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58087 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Extract all preferences-related code from DownloadManager to ↵phajdan.jr@chromium.org2010-08-301-2/+3
| | | | | | | | | | | DownloadPrefs. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3226010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57916 0039d316-1c4b-4281-b951-d872f2087c98
* Move prefs-related files under chrome/browser/ into a prefs/ subdir.evan@chromium.org2010-08-261-1/+1
| | | | | | | | | | | | Rename includes, resort header include order in places where the rename changed the order. BUG=50548 TEST=compiles Review URL: http://codereview.chromium.org/3203008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57434 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Forward declare everything possible in testing_profile.herg@google.com2010-08-131-0/+1
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3129007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56053 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up download code:phajdan.jr@chromium.org2010-08-051-589/+0
| | | | | | | | | | | | | | | | | | - move filename generation parts and related code out of DownloadManager download_util is not the best place for it, but it's better than DownloadManager which we're trying to minimize - clean up posting tasks to different threads. There's no need to create separate methods for that, it was cluttering the file needlessly - other minor cleanups, like using static_cast instead of C-style cast TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/3043048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55088 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in DownloadManagerTest.mnissler@chromium.org2010-07-221-2/+4
| | | | | | | | | BUG=49268, 49307 TEST=valgrind bots should be green on DownloadManagerTest Review URL: http://codereview.chromium.org/3038012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53314 0039d316-1c4b-4281-b951-d872f2087c98
* Rename the download to its final name only after the download is finishedkinuko@chromium.org2010-07-211-1/+143
| | | | | | | | | BUG=27687, 28928 TEST=DownloadManagerTest.DownloadRenameTest Review URL: http://codereview.chromium.org/2877008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53149 0039d316-1c4b-4281-b951-d872f2087c98
* Recommit r52848 - Option-click to download should not display "Save As" UI.jeremy@chromium.org2010-07-181-2/+3
| | | | | | Review URL: http://codereview.chromium.org/2825056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52850 0039d316-1c4b-4281-b951-d872f2087c98
* Download code cleanup: split big files into smaller one.phajdan.jr@chromium.org2010-07-161-0/+1
| | | | | | | | | | | | | It's hard to find things in the download directory. DownloadFile and DownloadFileManager were bundled together. Similarly for DownloadItem and DownloadManager, which was much less intuitive. Some 3-5 line structs were also in one bag with something else. I extracted them to their own small file. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/2806054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52749 0039d316-1c4b-4281-b951-d872f2087c98
* Don't prompt to save for filetypes marked as auto-open.pkasting@chromium.org2010-07-151-2/+85
| | | | | | | | | | | | Check if the generated file extension is in the auto-open list. If so, don't bother displaying the save as dialog even if the always prompt for download option is on. Original patch by James Simonsen (see http://codereview.chromium.org/2910003 ), r=me. BUG=18587 TEST=Turn on prompt for download option. Mark a filetype as always open. Download a file of that type and make sure no dialog appears. Review URL: http://codereview.chromium.org/2823043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52559 0039d316-1c4b-4281-b951-d872f2087c98
* Use DISALLOW_COPY_AND_ASSIGN instead of DISALLOW_EVIL_CONSTRUCTORS in chrome ↵tfarina@chromium.org2010-06-061-2/+2
| | | | | | | | | | | directory. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/2657003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49024 0039d316-1c4b-4281-b951-d872f2087c98
* Adding some known mime types to the platform_mime_utils on linux. This ↵dhg@chromium.org2010-05-181-4/+4
| | | | | | | | | | might not be a perfect solution right now, but its a simple stopgap. BUG=chromium-os:3242 TEST=none Review URL: http://codereview.chromium.org/2077006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47549 0039d316-1c4b-4281-b951-d872f2087c98
* Handle CreateFile() trimming trailing dots and spaces in downloads.jschuh@google.com2010-03-031-0/+27
| | | | | | | | | BUG=37007 TEST=unit_tests --gtest_filter=DownloadManagerTest.* Review URL: http://codereview.chromium.org/660297 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40479 0039d316-1c4b-4281-b951-d872f2087c98
* BSD port: another chunk of chrome/browser ifdef cleaningpvalchev@google.com2010-02-031-7/+7
| | | | | | Review URL: http://codereview.chromium.org/553153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38004 0039d316-1c4b-4281-b951-d872f2087c98
* Support dragging a virtual file out of the browser.jianli@chromium.org2010-01-151-4/+2
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/351029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36378 0039d316-1c4b-4281-b951-d872f2087c98
* A few more #ifdefs for platform-specific behaviors to port this test to mac.mark@chromium.org2009-10-221-52/+79
| | | | | | | | | | | Haven't tested outside of mac yet, so the guard for GetSafeFilename is still present for linux. Trybot should be run to make sure it passed in Win. BUG=21632 TEST=none Review URL: http://codereview.chromium.org/296001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29797 0039d316-1c4b-4281-b951-d872f2087c98
* Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.*brettw@chromium.org2009-10-071-1/+17
| | | | | | | | | | | | | | so we can do basic UTF8/16/32 conversions without linking all of ICU. Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using these new functions. I will remove the Sys versions of these functions in a later patch. TEST=none BUG=none Review URL: http://codereview.chromium.org/243102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98
* linux: port some of the download manager unit testevan@chromium.org2009-09-251-23/+137
| | | | | | | | | | | | Mostly lots of #ifdefs tracking platform behaviors. I tried to make the logic correct for Mac, too, but I didn't enable Mac here. BUG=21632 Review URL: http://codereview.chromium.org/220025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27260 0039d316-1c4b-4281-b951-d872f2087c98
* This CL makes Chrome on par with Firefox in terms of 'GetSuggestedFilename' ↵jungshik@google.com2009-05-011-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | for file download via context-menu. For a download initiated with a click on a link in a web page, a webkit-side change is necessary, which will be done later. Add a field (referrer_charset) to URLRequestContext and DownloadCreateInfo. It's set to the character encoding of a document where the download request originates from when it's known (download initiated via "save as" in the context menu). If it's not known (a download initiated by clicking on a download link or typing a url directly to the omnibox), it's initialized to the default character encoding in the user's preference. I guess this is marginally better than leaving it empty (in that case, step 2b below will be skipped and step 2c will be taken) because a user has a better control over how raw 8bit characters in C-D are interpreted (especially on Windows where a reboot is required to change the OS default codepage). This is later passed to GetSuggestedFilename and used as one of fallback encodings (1. UTF-8, 2. origin_charset, 3. default OS codepage). With this change, we support the following: 1. RFC 2047 2. Raw-8bit-characters : a. UTF-8, b. origin_charset, c. default os codepage. 3. %-escaped UTF-8. In this CL, for #3, I didn't add a fallback similar to one used for #2. If necessary, it can be added easily. New entries are added to 3 existing tests. What's previously not covered (raw 8bit Content-Disposition header) is now covered in all 3 tests. BUG=1148 TEST=net unit test: NetUtilTest.GetFileNameFromCD NetUtilTest.GetSuggestedFilename unittest : DownloadManagerTest.TestDownloadFilename Review URL: http://codereview.chromium.org/83002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15113 0039d316-1c4b-4281-b951-d872f2087c98
* Fix issue 7337, where a file of mime type "text/x-registry" with extension ↵sidchat@google.com2009-04-081-1/+7
| | | | | | | | | "reg" was getting saved with extension "download" instead. Issue=7337 Review URL: http://codereview.chromium.org/58007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13361 0039d316-1c4b-4281-b951-d872f2087c98
* Add an exception to DownloadManager::GenerateExtension() for .tar.gz files ↵thestig@chromium.org2009-03-251-0/+16
| | | | | | | | | with mime_type "application/x-tar". BUG=5772 Review URL: http://codereview.chromium.org/42622 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12509 0039d316-1c4b-4281-b951-d872f2087c98