| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 String str = selection.SelectedTextForClipboard(); | 348 String str = selection.SelectedTextForClipboard(); |
| 349 #if OS(WIN) | 349 #if OS(WIN) |
| 350 ReplaceNewlinesWithWindowsStyleNewlines(str); | 350 ReplaceNewlinesWithWindowsStyleNewlines(str); |
| 351 #endif | 351 #endif |
| 352 ReplaceNBSPWithSpace(str); | 352 ReplaceNBSPWithSpace(str); |
| 353 data_object_->SetData(kMimeTypeTextPlain, str); | 353 data_object_->SetData(kMimeTypeTextPlain, str); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void DataTransfer::SetAccessPolicy(DataTransferAccessPolicy policy) { | 356 void DataTransfer::SetAccessPolicy(DataTransferAccessPolicy policy) { |
| 357 // once you go numb, can never go back | 357 // once you go numb, can never go back |
| 358 ASSERT(policy_ != kDataTransferNumb || policy == kDataTransferNumb); | 358 DCHECK(policy_ != kDataTransferNumb || policy == kDataTransferNumb); |
| 359 policy_ = policy; | 359 policy_ = policy; |
| 360 } | 360 } |
| 361 | 361 |
| 362 bool DataTransfer::CanReadTypes() const { | 362 bool DataTransfer::CanReadTypes() const { |
| 363 return policy_ == kDataTransferReadable || | 363 return policy_ == kDataTransferReadable || |
| 364 policy_ == kDataTransferTypesReadable || | 364 policy_ == kDataTransferTypesReadable || |
| 365 policy_ == kDataTransferWritable; | 365 policy_ == kDataTransferWritable; |
| 366 } | 366 } |
| 367 | 367 |
| 368 bool DataTransfer::CanReadData() const { | 368 bool DataTransfer::CanReadData() const { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 379 } | 379 } |
| 380 | 380 |
| 381 DragOperation DataTransfer::SourceOperation() const { | 381 DragOperation DataTransfer::SourceOperation() const { |
| 382 DragOperation op = ConvertEffectAllowedToDragOperation(effect_allowed_); | 382 DragOperation op = ConvertEffectAllowedToDragOperation(effect_allowed_); |
| 383 DCHECK_NE(op, kDragOperationPrivate); | 383 DCHECK_NE(op, kDragOperationPrivate); |
| 384 return op; | 384 return op; |
| 385 } | 385 } |
| 386 | 386 |
| 387 DragOperation DataTransfer::DestinationOperation() const { | 387 DragOperation DataTransfer::DestinationOperation() const { |
| 388 DragOperation op = ConvertEffectAllowedToDragOperation(drop_effect_); | 388 DragOperation op = ConvertEffectAllowedToDragOperation(drop_effect_); |
| 389 ASSERT(op == kDragOperationCopy || op == kDragOperationNone || | 389 DCHECK(op == kDragOperationCopy || op == kDragOperationNone || |
| 390 op == kDragOperationLink || | 390 op == kDragOperationLink || |
| 391 op == (DragOperation)(kDragOperationGeneric | kDragOperationMove) || | 391 op == (DragOperation)(kDragOperationGeneric | kDragOperationMove) || |
| 392 op == kDragOperationEvery); | 392 op == kDragOperationEvery); |
| 393 return op; | 393 return op; |
| 394 } | 394 } |
| 395 | 395 |
| 396 void DataTransfer::SetSourceOperation(DragOperation op) { | 396 void DataTransfer::SetSourceOperation(DragOperation op) { |
| 397 DCHECK_NE(op, kDragOperationPrivate); | 397 DCHECK_NE(op, kDragOperationPrivate); |
| 398 effect_allowed_ = ConvertDragOperationToEffectAllowed(op); | 398 effect_allowed_ = ConvertDragOperationToEffectAllowed(op); |
| 399 } | 399 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 | 500 |
| 501 DEFINE_TRACE(DataTransfer) { | 501 DEFINE_TRACE(DataTransfer) { |
| 502 visitor->Trace(data_object_); | 502 visitor->Trace(data_object_); |
| 503 visitor->Trace(drag_image_); | 503 visitor->Trace(drag_image_); |
| 504 visitor->Trace(drag_image_element_); | 504 visitor->Trace(drag_image_element_); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace blink | 507 } // namespace blink |
| OLD | NEW |