| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (cleanType == mimeTypeText || cleanType.startsWith(mimeTypeTextPlainEtc)) | 98 if (cleanType == mimeTypeText || cleanType.startsWith(mimeTypeTextPlainEtc)) |
| 99 return mimeTypeTextPlain; | 99 return mimeTypeTextPlain; |
| 100 if (cleanType == mimeTypeURL) { | 100 if (cleanType == mimeTypeURL) { |
| 101 if (convertToURL) | 101 if (convertToURL) |
| 102 *convertToURL = true; | 102 *convertToURL = true; |
| 103 return mimeTypeTextURIList; | 103 return mimeTypeTextURIList; |
| 104 } | 104 } |
| 105 return cleanType; | 105 return cleanType; |
| 106 } | 106 } |
| 107 | 107 |
| 108 PassRefPtrWillBeRawPtr<DataTransfer> DataTransfer::create(DataTransferType type,
DataTransferAccessPolicy policy, PassRefPtrWillBeRawPtr<DataObject> dataObject) | 108 DataTransfer* DataTransfer::create(DataTransferType type, DataTransferAccessPoli
cy policy, DataObject* dataObject) |
| 109 { | 109 { |
| 110 return adoptRefWillBeNoop(new DataTransfer(type, policy, dataObject)); | 110 return new DataTransfer(type, policy, dataObject); |
| 111 } | 111 } |
| 112 | 112 |
| 113 DataTransfer::~DataTransfer() | 113 DataTransfer::~DataTransfer() |
| 114 { | 114 { |
| 115 } | 115 } |
| 116 | 116 |
| 117 void DataTransfer::setDropEffect(const String &effect) | 117 void DataTransfer::setDropEffect(const String &effect) |
| 118 { | 118 { |
| 119 if (!isForDragAndDrop()) | 119 if (!isForDragAndDrop()) |
| 120 return; | 120 return; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 { | 435 { |
| 436 if (keyword.startsWith("file:")) | 436 if (keyword.startsWith("file:")) |
| 437 return hasFileOfType(keyword.substring(5)); | 437 return hasFileOfType(keyword.substring(5)); |
| 438 | 438 |
| 439 if (keyword.startsWith("string:")) | 439 if (keyword.startsWith("string:")) |
| 440 return hasStringOfType(keyword.substring(7)); | 440 return hasStringOfType(keyword.substring(7)); |
| 441 | 441 |
| 442 return false; | 442 return false; |
| 443 } | 443 } |
| 444 | 444 |
| 445 PassRefPtrWillBeRawPtr<DataTransferItemList> DataTransfer::items() | 445 DataTransferItemList* DataTransfer::items() |
| 446 { | 446 { |
| 447 // FIXME: According to the spec, we are supposed to return the same collecti
on of items each | 447 // FIXME: According to the spec, we are supposed to return the same collecti
on of items each |
| 448 // time. We now return a wrapper that always wraps the *same* set of items,
so JS shouldn't be | 448 // time. We now return a wrapper that always wraps the *same* set of items,
so JS shouldn't be |
| 449 // able to tell, but we probably still want to fix this. | 449 // able to tell, but we probably still want to fix this. |
| 450 return DataTransferItemList::create(this, m_dataObject); | 450 return DataTransferItemList::create(this, m_dataObject); |
| 451 } | 451 } |
| 452 | 452 |
| 453 PassRefPtrWillBeRawPtr<DataObject> DataTransfer::dataObject() const | 453 DataObject* DataTransfer::dataObject() const |
| 454 { | 454 { |
| 455 return m_dataObject; | 455 return m_dataObject; |
| 456 } | 456 } |
| 457 | 457 |
| 458 DataTransfer::DataTransfer(DataTransferType type, DataTransferAccessPolicy polic
y, PassRefPtrWillBeRawPtr<DataObject> dataObject) | 458 DataTransfer::DataTransfer(DataTransferType type, DataTransferAccessPolicy polic
y, DataObject* dataObject) |
| 459 : m_policy(policy) | 459 : m_policy(policy) |
| 460 , m_dropEffect("uninitialized") | 460 , m_dropEffect("uninitialized") |
| 461 , m_effectAllowed("uninitialized") | 461 , m_effectAllowed("uninitialized") |
| 462 , m_transferType(type) | 462 , m_transferType(type) |
| 463 , m_dataObject(dataObject) | 463 , m_dataObject(dataObject) |
| 464 { | 464 { |
| 465 } | 465 } |
| 466 | 466 |
| 467 void DataTransfer::setDragImage(ImageResource* image, Node* node, const IntPoint
& loc) | 467 void DataTransfer::setDragImage(ImageResource* image, Node* node, const IntPoint
& loc) |
| 468 { | 468 { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 case DragOperationLink: | 519 case DragOperationLink: |
| 520 return String("link"); | 520 return String("link"); |
| 521 default: | 521 default: |
| 522 return String("copy"); | 522 return String("copy"); |
| 523 } | 523 } |
| 524 } | 524 } |
| 525 | 525 |
| 526 DEFINE_TRACE(DataTransfer) | 526 DEFINE_TRACE(DataTransfer) |
| 527 { | 527 { |
| 528 visitor->trace(m_dataObject); | 528 visitor->trace(m_dataObject); |
| 529 #if ENABLE(OILPAN) |
| 529 visitor->trace(m_dragImageElement); | 530 visitor->trace(m_dragImageElement); |
| 531 #endif |
| 530 } | 532 } |
| 531 | 533 |
| 532 } // namespace blink | 534 } // namespace blink |
| OLD | NEW |