| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 } | 452 } |
| 453 | 453 |
| 454 // Returns whether caller should continue with "the default processing", which i
s the same as | 454 // Returns whether caller should continue with "the default processing", which i
s the same as |
| 455 // the event handler NOT setting the return value to false | 455 // the event handler NOT setting the return value to false |
| 456 bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli
cy policy, PasteMode pasteMode) | 456 bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli
cy policy, PasteMode pasteMode) |
| 457 { | 457 { |
| 458 Node* target = findEventTargetFromSelection(); | 458 Node* target = findEventTargetFromSelection(); |
| 459 if (!target) | 459 if (!target) |
| 460 return true; | 460 return true; |
| 461 | 461 |
| 462 RefPtr<Clipboard> clipboard = Clipboard::create( | 462 RefPtrWillBeRawPtr<Clipboard> clipboard = Clipboard::create( |
| 463 Clipboard::CopyAndPaste, | 463 Clipboard::CopyAndPaste, |
| 464 policy, | 464 policy, |
| 465 policy == ClipboardWritable | 465 policy == ClipboardWritable |
| 466 ? DataObject::create() | 466 ? DataObject::create() |
| 467 : DataObject::createFromPasteboard(pasteMode)); | 467 : DataObject::createFromPasteboard(pasteMode)); |
| 468 | 468 |
| 469 RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard)
; | 469 RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard)
; |
| 470 target->dispatchEvent(evt, IGNORE_EXCEPTION); | 470 target->dispatchEvent(evt, IGNORE_EXCEPTION); |
| 471 bool noDefaultProcessing = evt->defaultPrevented(); | 471 bool noDefaultProcessing = evt->defaultPrevented(); |
| 472 if (noDefaultProcessing && policy == ClipboardWritable) { | 472 if (noDefaultProcessing && policy == ClipboardWritable) { |
| 473 RefPtr<DataObject> dataObject = clipboard->dataObject(); | 473 RefPtrWillBeRawPtr<DataObject> dataObject = clipboard->dataObject(); |
| 474 Pasteboard::generalPasteboard()->writeDataObject(dataObject.release()); | 474 Pasteboard::generalPasteboard()->writeDataObject(dataObject.release()); |
| 475 } | 475 } |
| 476 | 476 |
| 477 // invalidate clipboard here for security | 477 // invalidate clipboard here for security |
| 478 clipboard->setAccessPolicy(ClipboardNumb); | 478 clipboard->setAccessPolicy(ClipboardNumb); |
| 479 | 479 |
| 480 return !noDefaultProcessing; | 480 return !noDefaultProcessing; |
| 481 } | 481 } |
| 482 | 482 |
| 483 bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard) | 483 bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard) |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 return m_frame.spellChecker(); | 1231 return m_frame.spellChecker(); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 void Editor::toggleOverwriteModeEnabled() | 1234 void Editor::toggleOverwriteModeEnabled() |
| 1235 { | 1235 { |
| 1236 m_overwriteModeEnabled = !m_overwriteModeEnabled; | 1236 m_overwriteModeEnabled = !m_overwriteModeEnabled; |
| 1237 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); | 1237 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 } // namespace WebCore | 1240 } // namespace WebCore |
| OLD | NEW |