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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (cleanType == mimeTypeText || cleanType.startsWith(mimeTypeTextPlainEtc)) | 102 if (cleanType == mimeTypeText || cleanType.startsWith(mimeTypeTextPlainEtc)) |
103 return mimeTypeTextPlain; | 103 return mimeTypeTextPlain; |
104 if (cleanType == mimeTypeURL) { | 104 if (cleanType == mimeTypeURL) { |
105 if (convertToURL) | 105 if (convertToURL) |
106 *convertToURL = true; | 106 *convertToURL = true; |
107 return mimeTypeTextURIList; | 107 return mimeTypeTextURIList; |
108 } | 108 } |
109 return cleanType; | 109 return cleanType; |
110 } | 110 } |
111 | 111 |
| 112 DataTransfer* DataTransfer::create() { |
| 113 DataTransfer* data = |
| 114 create(CopyAndPaste, DataTransferWritable, DataObject::create()); |
| 115 data->m_dropEffect = "none"; |
| 116 data->m_effectAllowed = "none"; |
| 117 return data; |
| 118 } |
| 119 |
112 DataTransfer* DataTransfer::create(DataTransferType type, | 120 DataTransfer* DataTransfer::create(DataTransferType type, |
113 DataTransferAccessPolicy policy, | 121 DataTransferAccessPolicy policy, |
114 DataObject* dataObject) { | 122 DataObject* dataObject) { |
115 return new DataTransfer(type, policy, dataObject); | 123 return new DataTransfer(type, policy, dataObject); |
116 } | 124 } |
117 | 125 |
118 DataTransfer::~DataTransfer() {} | 126 DataTransfer::~DataTransfer() {} |
119 | 127 |
120 void DataTransfer::setDropEffect(const String& effect) { | 128 void DataTransfer::setDropEffect(const String& effect) { |
121 if (!isForDragAndDrop()) | 129 if (!isForDragAndDrop()) |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 } | 485 } |
478 } | 486 } |
479 | 487 |
480 DEFINE_TRACE(DataTransfer) { | 488 DEFINE_TRACE(DataTransfer) { |
481 visitor->trace(m_dataObject); | 489 visitor->trace(m_dataObject); |
482 visitor->trace(m_dragImage); | 490 visitor->trace(m_dragImage); |
483 visitor->trace(m_dragImageElement); | 491 visitor->trace(m_dragImageElement); |
484 } | 492 } |
485 | 493 |
486 } // namespace blink | 494 } // namespace blink |
OLD | NEW |