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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 void Editor::copyImage(const HitTestResult& result) { | 1250 void Editor::copyImage(const HitTestResult& result) { |
1251 writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), | 1251 writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), |
1252 result.innerNodeOrImageMapImage(), | 1252 result.innerNodeOrImageMapImage(), |
1253 result.altDisplayString()); | 1253 result.altDisplayString()); |
1254 } | 1254 } |
1255 | 1255 |
1256 bool Editor::canUndo() { | 1256 bool Editor::canUndo() { |
1257 return m_undoStack->canUndo(); | 1257 return m_undoStack->canUndo(); |
1258 } | 1258 } |
1259 | 1259 |
1260 void Editor::undo(EditCommandSource source) { | 1260 // TODO(chongz): Fire 'beforeinput' for user triggered undo. |
1261 m_undoStack->undo(source); | 1261 void Editor::undo(EditCommandSource) { |
| 1262 m_undoStack->undo(); |
1262 } | 1263 } |
1263 | 1264 |
1264 bool Editor::canRedo() { | 1265 bool Editor::canRedo() { |
1265 return m_undoStack->canRedo(); | 1266 return m_undoStack->canRedo(); |
1266 } | 1267 } |
1267 | 1268 |
1268 void Editor::redo(EditCommandSource source) { | 1269 // TODO(chongz): Fire 'beforeinput' for user triggered redo. |
1269 m_undoStack->redo(source); | 1270 void Editor::redo(EditCommandSource) { |
| 1271 m_undoStack->redo(); |
1270 } | 1272 } |
1271 | 1273 |
1272 void Editor::setBaseWritingDirection(WritingDirection direction) { | 1274 void Editor::setBaseWritingDirection(WritingDirection direction) { |
1273 Element* focusedElement = frame().document()->focusedElement(); | 1275 Element* focusedElement = frame().document()->focusedElement(); |
1274 if (isTextControlElement(focusedElement)) { | 1276 if (isTextControlElement(focusedElement)) { |
1275 if (direction == NaturalWritingDirection) | 1277 if (direction == NaturalWritingDirection) |
1276 return; | 1278 return; |
1277 focusedElement->setAttribute( | 1279 focusedElement->setAttribute( |
1278 dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl"); | 1280 dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl"); |
1279 focusedElement->dispatchInputEvent(); | 1281 focusedElement->dispatchInputEvent(); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 } | 1709 } |
1708 | 1710 |
1709 DEFINE_TRACE(Editor) { | 1711 DEFINE_TRACE(Editor) { |
1710 visitor->trace(m_frame); | 1712 visitor->trace(m_frame); |
1711 visitor->trace(m_lastEditCommand); | 1713 visitor->trace(m_lastEditCommand); |
1712 visitor->trace(m_undoStack); | 1714 visitor->trace(m_undoStack); |
1713 visitor->trace(m_mark); | 1715 visitor->trace(m_mark); |
1714 } | 1716 } |
1715 | 1717 |
1716 } // namespace blink | 1718 } // namespace blink |
OLD | NEW |