OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 if (Chrome* chrome = this->chrome()) { | 152 if (Chrome* chrome = this->chrome()) { |
153 FileChooserSettings settings; | 153 FileChooserSettings settings; |
154 HTMLInputElement& input = element(); | 154 HTMLInputElement& input = element(); |
155 settings.allowsDirectoryUpload = input.fastHasAttribute(webkitdirectoryA
ttr); | 155 settings.allowsDirectoryUpload = input.fastHasAttribute(webkitdirectoryA
ttr); |
156 settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input.f
astHasAttribute(multipleAttr); | 156 settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input.f
astHasAttribute(multipleAttr); |
157 settings.acceptMIMETypes = input.acceptMIMETypes(); | 157 settings.acceptMIMETypes = input.acceptMIMETypes(); |
158 settings.acceptFileExtensions = input.acceptFileExtensions(); | 158 settings.acceptFileExtensions = input.acceptFileExtensions(); |
159 settings.selectedFiles = m_fileList->paths(); | 159 settings.selectedFiles = m_fileList->paths(); |
160 #if ENABLE(MEDIA_CAPTURE) | 160 #if ENABLE(MEDIA_CAPTURE) |
161 settings.useMediaCapture = input.capture(); | 161 settings.useMediaCapture = input.isFileUpload() && input.fastHasAttribut
e(captureAttr); |
162 #endif | 162 #endif |
163 chrome->runOpenPanel(input.document().frame(), newFileChooser(settings))
; | 163 chrome->runOpenPanel(input.document().frame(), newFileChooser(settings))
; |
164 } | 164 } |
165 event->setDefaultHandled(); | 165 event->setDefaultHandled(); |
166 } | 166 } |
167 | 167 |
168 RenderObject* FileInputType::createRenderer(RenderStyle*) const | 168 RenderObject* FileInputType::createRenderer(RenderStyle*) const |
169 { | 169 { |
170 return new RenderFileUploadControl(&element()); | 170 return new RenderFileUploadControl(&element()); |
171 } | 171 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 StringBuilder names; | 389 StringBuilder names; |
390 for (size_t i = 0; i < listSize; ++i) { | 390 for (size_t i = 0; i < listSize; ++i) { |
391 names.append(fileList->item(i)->name()); | 391 names.append(fileList->item(i)->name()); |
392 if (i != listSize - 1) | 392 if (i != listSize - 1) |
393 names.append('\n'); | 393 names.append('\n'); |
394 } | 394 } |
395 return names.toString(); | 395 return names.toString(); |
396 } | 396 } |
397 | 397 |
398 } // namespace WebCore | 398 } // namespace WebCore |
OLD | NEW |