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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 filesChosen(firstFileOnly); | 353 filesChosen(firstFileOnly); |
354 } | 354 } |
355 return true; | 355 return true; |
356 } | 356 } |
357 | 357 |
358 String FileInputType::droppedFileSystemId() | 358 String FileInputType::droppedFileSystemId() |
359 { | 359 { |
360 return m_droppedFileSystemId; | 360 return m_droppedFileSystemId; |
361 } | 361 } |
362 | 362 |
| 363 void FileInputType::copyNonAttributeProperties(const HTMLInputElement& sourceEle
ment) |
| 364 { |
| 365 RefPtrWillBeRawPtr<FileList> fileList(FileList::create()); |
| 366 FileList* sourceFileList = sourceElement.files(); |
| 367 unsigned size = sourceFileList->length(); |
| 368 for (unsigned i = 0; i < size; ++i) { |
| 369 File* file = sourceFileList->item(i); |
| 370 fileList->append(File::createWithRelativePath(file->path(), file->webkit
RelativePath())); |
| 371 } |
| 372 setFiles(fileList.release()); |
| 373 } |
| 374 |
363 String FileInputType::defaultToolTip() const | 375 String FileInputType::defaultToolTip() const |
364 { | 376 { |
365 FileList* fileList = m_fileList.get(); | 377 FileList* fileList = m_fileList.get(); |
366 unsigned listSize = fileList->length(); | 378 unsigned listSize = fileList->length(); |
367 if (!listSize) { | 379 if (!listSize) { |
368 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected
Label); | 380 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected
Label); |
369 } | 381 } |
370 | 382 |
371 StringBuilder names; | 383 StringBuilder names; |
372 for (size_t i = 0; i < listSize; ++i) { | 384 for (size_t i = 0; i < listSize; ++i) { |
373 names.append(fileList->item(i)->name()); | 385 names.append(fileList->item(i)->name()); |
374 if (i != listSize - 1) | 386 if (i != listSize - 1) |
375 names.append('\n'); | 387 names.append('\n'); |
376 } | 388 } |
377 return names.toString(); | 389 return names.toString(); |
378 } | 390 } |
379 | 391 |
380 } // namespace WebCore | 392 } // namespace WebCore |
OLD | NEW |