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::copyFiles(PassRefPtrWillBeRawPtr<FileList> files) |
| 364 { |
| 365 RefPtrWillBeRawPtr<FileList> fileList(FileList::create()); |
| 366 unsigned size = files->length(); |
| 367 for (unsigned i = 0; i < size; ++i) { |
| 368 File* file = files->item(i); |
| 369 fileList->append(File::createWithRelativePath(file->path(), file->webkit
RelativePath())); |
| 370 } |
| 371 setFiles(fileList.release()); |
| 372 } |
| 373 |
363 String FileInputType::defaultToolTip() const | 374 String FileInputType::defaultToolTip() const |
364 { | 375 { |
365 FileList* fileList = m_fileList.get(); | 376 FileList* fileList = m_fileList.get(); |
366 unsigned listSize = fileList->length(); | 377 unsigned listSize = fileList->length(); |
367 if (!listSize) { | 378 if (!listSize) { |
368 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected
Label); | 379 return locale().queryString(WebLocalizedString::FileButtonNoFileSelected
Label); |
369 } | 380 } |
370 | 381 |
371 StringBuilder names; | 382 StringBuilder names; |
372 for (size_t i = 0; i < listSize; ++i) { | 383 for (size_t i = 0; i < listSize; ++i) { |
373 names.append(fileList->item(i)->name()); | 384 names.append(fileList->item(i)->name()); |
374 if (i != listSize - 1) | 385 if (i != listSize - 1) |
375 names.append('\n'); | 386 names.append('\n'); |
376 } | 387 } |
377 return names.toString(); | 388 return names.toString(); |
378 } | 389 } |
379 | 390 |
380 } // namespace WebCore | 391 } // namespace WebCore |
OLD | NEW |