Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2631743002: Revert of [Editing] Introduce |EditCommandComposition::willUn/Reapply()| in prepare for (2/3) (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698