summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 07:39:50 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 07:39:50 +0000
commit212476da17fa6558cbb686eae3e087dfcd4f480d (patch)
tree2415f400698eb0dbed17608f50e9562b3473ca41 /webkit
parent9399f36785e73a6d87c3790195673b3ad3e5f14d (diff)
downloadchromium_src-212476da17fa6558cbb686eae3e087dfcd4f480d.zip
chromium_src-212476da17fa6558cbb686eae3e087dfcd4f480d.tar.gz
chromium_src-212476da17fa6558cbb686eae3e087dfcd4f480d.tar.bz2
Don't call FileChooser::chooseFile("") if a user selects nothing with a file chooser dialog.
chooseFiles() works well even for an empty vector. BUG=14162,14164 TEST=Open an image upload dialog of Gmail or Google Sites, Click the file upload button, Click the Cancel button in the file chooser dialog. Confirm that the dialog doesn't show "[failed]" message. Review URL: http://codereview.chromium.org/125175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/chrome_client_impl.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc
index 4b6ab72..160833e 100644
--- a/webkit/glue/chrome_client_impl.cc
+++ b/webkit/glue/chrome_client_impl.cc
@@ -60,12 +60,11 @@ class WebFileChooserCallbackImpl : public WebFileChooserCallback {
}
virtual void OnFileChoose(const std::vector<FilePath>& file_names) {
- if (file_names.empty()) {
- file_chooser_->chooseFile(WebCore::String(""));
- } else if (file_names.size() == 1) {
+ if (file_names.size() == 1) {
file_chooser_->chooseFile(
webkit_glue::FilePathStringToString(file_names.front().value()));
} else {
+ // This clause handles a case of file_names.size()==0 too.
Vector<WebCore::String> paths;
for (std::vector<FilePath>::const_iterator filename =
file_names.begin(); filename != file_names.end(); ++filename) {