| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Google Inc. | 3 * Copyright (C) 2008 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 frame->selection().setSelection(dragCaret); | 431 frame->selection().setSelection(dragCaret); |
| 432 range = dragCaret.toNormalizedRange(); | 432 range = dragCaret.toNormalizedRange(); |
| 433 } | 433 } |
| 434 return !frame->selection().isNone() && frame->selection().isContentEditable(
); | 434 return !frame->selection().isNone() && frame->selection().isContentEditable(
); |
| 435 } | 435 } |
| 436 | 436 |
| 437 bool DragController::dispatchTextInputEventFor(LocalFrame* innerFrame, DragData*
dragData) | 437 bool DragController::dispatchTextInputEventFor(LocalFrame* innerFrame, DragData*
dragData) |
| 438 { | 438 { |
| 439 ASSERT(m_page->dragCaretController().hasCaret()); | 439 ASSERT(m_page->dragCaretController().hasCaret()); |
| 440 String text = m_page->dragCaretController().isContentRichlyEditable() ? "" :
dragData->asPlainText(); | 440 String text = m_page->dragCaretController().isContentRichlyEditable() ? "" :
dragData->asPlainText(); |
| 441 Node* target = innerFrame->editor().findEventTargetFrom(VisibleSelection(m_p
age->dragCaretController().caretPosition())); | 441 Element* target = innerFrame->editor().findEventTargetFrom(VisibleSelection(
m_page->dragCaretController().caretPosition())); |
| 442 return target->dispatchEvent(TextEvent::createForDrop(innerFrame->domWindow(
), text), IGNORE_EXCEPTION); | 442 return target->dispatchEvent(TextEvent::createForDrop(innerFrame->domWindow(
), text), IGNORE_EXCEPTION); |
| 443 } | 443 } |
| 444 | 444 |
| 445 bool DragController::concludeEditDrag(DragData* dragData) | 445 bool DragController::concludeEditDrag(DragData* dragData) |
| 446 { | 446 { |
| 447 ASSERT(dragData); | 447 ASSERT(dragData); |
| 448 | 448 |
| 449 RefPtrWillBeRawPtr<HTMLInputElement> fileInput = m_fileInputElementUnderMous
e; | 449 RefPtrWillBeRawPtr<HTMLInputElement> fileInput = m_fileInputElementUnderMous
e; |
| 450 if (m_fileInputElementUnderMouse) { | 450 if (m_fileInputElementUnderMouse) { |
| 451 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); | 451 m_fileInputElementUnderMouse->setCanReceiveDroppedFiles(false); |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 965 |
| 966 void DragController::trace(Visitor* visitor) | 966 void DragController::trace(Visitor* visitor) |
| 967 { | 967 { |
| 968 visitor->trace(m_page); | 968 visitor->trace(m_page); |
| 969 visitor->trace(m_documentUnderMouse); | 969 visitor->trace(m_documentUnderMouse); |
| 970 visitor->trace(m_dragInitiator); | 970 visitor->trace(m_dragInitiator); |
| 971 visitor->trace(m_fileInputElementUnderMouse); | 971 visitor->trace(m_fileInputElementUnderMouse); |
| 972 } | 972 } |
| 973 | 973 |
| 974 } // namespace blink | 974 } // namespace blink |
| OLD | NEW |