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