| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 372 |
| 373 String str = text; | 373 String str = text; |
| 374 #if OS(WIN) | 374 #if OS(WIN) |
| 375 replaceNewlinesWithWindowsStyleNewlines(str); | 375 replaceNewlinesWithWindowsStyleNewlines(str); |
| 376 #endif | 376 #endif |
| 377 replaceNBSPWithSpace(str); | 377 replaceNBSPWithSpace(str); |
| 378 | 378 |
| 379 m_dataObject->setData(mimeTypeTextPlain, str); | 379 m_dataObject->setData(mimeTypeTextPlain, str); |
| 380 } | 380 } |
| 381 | 381 |
| 382 bool DataTransfer::hasData() | |
| 383 { | |
| 384 ASSERT(isForDragAndDrop()); | |
| 385 | |
| 386 return m_dataObject->length() > 0; | |
| 387 } | |
| 388 | |
| 389 void DataTransfer::setAccessPolicy(DataTransferAccessPolicy policy) | 382 void DataTransfer::setAccessPolicy(DataTransferAccessPolicy policy) |
| 390 { | 383 { |
| 391 // once you go numb, can never go back | 384 // once you go numb, can never go back |
| 392 ASSERT(m_policy != DataTransferNumb || policy == DataTransferNumb); | 385 ASSERT(m_policy != DataTransferNumb || policy == DataTransferNumb); |
| 393 m_policy = policy; | 386 m_policy = policy; |
| 394 } | 387 } |
| 395 | 388 |
| 396 bool DataTransfer::canReadTypes() const | 389 bool DataTransfer::canReadTypes() const |
| 397 { | 390 { |
| 398 return m_policy == DataTransferReadable || m_policy == DataTransferTypesRead
able || m_policy == DataTransferWritable; | 391 return m_policy == DataTransferReadable || m_policy == DataTransferTypesRead
able || m_policy == DataTransferWritable; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 524 } |
| 532 } | 525 } |
| 533 | 526 |
| 534 void DataTransfer::trace(Visitor* visitor) | 527 void DataTransfer::trace(Visitor* visitor) |
| 535 { | 528 { |
| 536 visitor->trace(m_dataObject); | 529 visitor->trace(m_dataObject); |
| 537 visitor->trace(m_dragImageElement); | 530 visitor->trace(m_dragImageElement); |
| 538 } | 531 } |
| 539 | 532 |
| 540 } // namespace blink | 533 } // namespace blink |
| OLD | NEW |