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

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

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 node)) 64 node))
65 return false; 65 return false;
66 66
67 VisiblePosition next = nextPositionOf(visiblePosition); 67 VisiblePosition next = nextPositionOf(visiblePosition);
68 return next.isNull() || 68 return next.isNull() ||
69 !next.deepEquivalent().anchorNode()->isDescendantOf(node); 69 !next.deepEquivalent().anchorNode()->isDescendantOf(node);
70 } 70 }
71 71
72 } // namespace 72 } // namespace
73 73
74 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) 74 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document,
75 : CompositeEditCommand(document) {} 75 CommandSource source)
76 : CompositeEditCommand(document, source) {}
76 77
77 void BreakBlockquoteCommand::doApply(EditingState* editingState) { 78 void BreakBlockquoteCommand::doApply(EditingState* editingState) {
78 if (endingSelection().isNone()) 79 if (endingSelection().isNone())
79 return; 80 return;
80 81
81 // Delete the current selection. 82 // Delete the current selection.
82 if (endingSelection().isRange()) { 83 if (endingSelection().isRange()) {
83 deleteSelection(editingState, false, false); 84 deleteSelection(editingState, false, false);
84 if (editingState->isAborted()) 85 if (editingState->isAborted())
85 return; 86 return;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 269
269 // Put the selection right before the break. 270 // Put the selection right before the break.
270 setEndingSelection(SelectionInDOMTree::Builder() 271 setEndingSelection(SelectionInDOMTree::Builder()
271 .collapse(Position::beforeNode(breakElement)) 272 .collapse(Position::beforeNode(breakElement))
272 .setIsDirectional(endingSelection().isDirectional()) 273 .setIsDirectional(endingSelection().isDirectional())
273 .build()); 274 .build());
274 rebalanceWhitespace(); 275 rebalanceWhitespace();
275 } 276 }
276 277
277 } // namespace blink 278 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698