summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/shell_dialogs_win.cc
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 08:02:00 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 08:02:00 +0000
commitef7217742633b7761710dcea757a948c4f68c0ff (patch)
tree8cdcf29b50e2ca0b86ba9a81c370fe4858c86675 /chrome/browser/views/shell_dialogs_win.cc
parentf4e71f6b5394b62292195978e3669a01e954fef3 (diff)
downloadchromium_src-ef7217742633b7761710dcea757a948c4f68c0ff.zip
chromium_src-ef7217742633b7761710dcea757a948c4f68c0ff.tar.gz
chromium_src-ef7217742633b7761710dcea757a948c4f68c0ff.tar.bz2
Fix a bug that <input type=file multiple> doesn't accept many files.
The old code restricted the total characters of selected files to MAX_PATH (256). It is insufficient for multiple files. The new code uses UNICODE_STRING_MAX_CHARS (32767), which is the maximum string length of Win32 API. Firefox uses 4096. BUG=44068 TEST=No automated test because it's very hard to test the behavior of Windows' file open dialog. Manual test: Make two files on a local disk. The length of their names should be 200 characters. Visit a page with <input type=file multiple>, click the file upload control, and select these two files. The file upload control should show "2 files". Review URL: http://codereview.chromium.org/4198004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/shell_dialogs_win.cc')
-rw-r--r--chrome/browser/views/shell_dialogs_win.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc
index d3fe7ae..bc5f92b 100644
--- a/chrome/browser/views/shell_dialogs_win.cc
+++ b/chrome/browser/views/shell_dialogs_win.cc
@@ -891,10 +891,11 @@ bool SelectFileDialogImpl::RunOpenMultiFileDialog(
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = owner;
- wchar_t filename[MAX_PATH] = L"";
+ scoped_array<wchar_t> filename(new wchar_t[UNICODE_STRING_MAX_CHARS]);
+ filename[0] = 0;
- ofn.lpstrFile = filename;
- ofn.nMaxFile = MAX_PATH;
+ ofn.lpstrFile = filename.get();
+ ofn.nMaxFile = UNICODE_STRING_MAX_CHARS;
// We use OFN_NOCHANGEDIR so that the user can rename or delete the directory
// without having to close Chrome first.
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXPLORER