OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 { | 187 { |
188 Vector<String> types; | 188 Vector<String> types; |
189 if (!canReadTypes()) | 189 if (!canReadTypes()) |
190 return types; | 190 return types; |
191 | 191 |
192 ListHashSet<String> typesSet = m_dataObject->types(); | 192 ListHashSet<String> typesSet = m_dataObject->types(); |
193 types.appendRange(typesSet.begin(), typesSet.end()); | 193 types.appendRange(typesSet.begin(), typesSet.end()); |
194 return types; | 194 return types; |
195 } | 195 } |
196 | 196 |
197 PassRefPtr<FileList> Clipboard::files() const | 197 PassRefPtrWillBeRawPtr<FileList> Clipboard::files() const |
198 { | 198 { |
199 RefPtr<FileList> files = FileList::create(); | 199 RefPtrWillBeRawPtr<FileList> files = FileList::create(); |
200 if (!canReadData()) | 200 if (!canReadData()) |
201 return files.release(); | 201 return files.release(); |
202 | 202 |
203 for (size_t i = 0; i < m_dataObject->length(); ++i) { | 203 for (size_t i = 0; i < m_dataObject->length(); ++i) { |
204 if (m_dataObject->item(i)->kind() == DataObjectItem::FileKind) { | 204 if (m_dataObject->item(i)->kind() == DataObjectItem::FileKind) { |
205 RefPtr<Blob> blob = m_dataObject->item(i)->getAsFile(); | 205 RefPtrWillBeRawPtr<Blob> blob = m_dataObject->item(i)->getAsFile(); |
206 if (blob && blob->isFile()) | 206 if (blob && blob->isFile()) |
207 files->append(toFile(blob.get())); | 207 files->append(toFile(blob.get())); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 return files.release(); | 211 return files.release(); |
212 } | 212 } |
213 | 213 |
214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep
tionState) | 214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep
tionState) |
215 { | 215 { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 m_dragImage = image; | 471 m_dragImage = image; |
472 m_dragLoc = loc; | 472 m_dragLoc = loc; |
473 m_dragImageElement = node; | 473 m_dragImageElement = node; |
474 } | 474 } |
475 | 475 |
476 bool Clipboard::hasFileOfType(const String& type) const | 476 bool Clipboard::hasFileOfType(const String& type) const |
477 { | 477 { |
478 if (!canReadTypes()) | 478 if (!canReadTypes()) |
479 return false; | 479 return false; |
480 | 480 |
481 RefPtr<FileList> fileList = files(); | 481 RefPtrWillBeRawPtr<FileList> fileList = files(); |
482 if (fileList->isEmpty()) | 482 if (fileList->isEmpty()) |
483 return false; | 483 return false; |
484 | 484 |
485 for (unsigned f = 0; f < fileList->length(); f++) { | 485 for (unsigned f = 0; f < fileList->length(); f++) { |
486 if (equalIgnoringCase(fileList->item(f)->type(), type)) | 486 if (equalIgnoringCase(fileList->item(f)->type(), type)) |
487 return true; | 487 return true; |
488 } | 488 } |
489 return false; | 489 return false; |
490 } | 490 } |
491 | 491 |
(...skipping 29 matching lines...) Expand all Loading... |
521 return String("copy"); | 521 return String("copy"); |
522 } | 522 } |
523 } | 523 } |
524 | 524 |
525 void Clipboard::trace(Visitor* visitor) | 525 void Clipboard::trace(Visitor* visitor) |
526 { | 526 { |
527 visitor->trace(m_dataObject); | 527 visitor->trace(m_dataObject); |
528 } | 528 } |
529 | 529 |
530 } // namespace WebCore | 530 } // namespace WebCore |
OLD | NEW |