Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 command->SetEndingVisibleSelection(selection); | 209 command->SetEndingVisibleSelection(selection); |
| 210 } | 210 } |
| 211 command->DoApply(editing_state); | 211 command->DoApply(editing_state); |
| 212 if (!editing_state->IsAborted()) | 212 if (!editing_state->IsAborted()) |
| 213 commands_.push_back(command); | 213 commands_.push_back(command); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void CompositeEditCommand::AppendCommandToUndoStep( | 216 void CompositeEditCommand::AppendCommandToUndoStep( |
| 217 CompositeEditCommand* command) { | 217 CompositeEditCommand* command) { |
| 218 EnsureUndoStep()->Append(command->EnsureUndoStep()); | 218 EnsureUndoStep()->Append(command->EnsureUndoStep()); |
| 219 EnsureUndoStep()->SetEndingSelection( | |
|
yosin_UTC9
2017/05/08 04:01:05
Could you move |SetEndingSelection()| call to |Edi
chongz
2017/05/08 23:37:53
Moved to |Editor::AppliedEditing()| but I have to
| |
| 220 command->EnsureUndoStep()->EndingSelection()); | |
| 219 command->undo_step_ = nullptr; | 221 command->undo_step_ = nullptr; |
| 220 command->SetParent(this); | 222 command->SetParent(this); |
| 221 commands_.push_back(command); | 223 commands_.push_back(command); |
| 222 } | 224 } |
| 223 | 225 |
| 224 void CompositeEditCommand::ApplyStyle(const EditingStyle* style, | 226 void CompositeEditCommand::ApplyStyle(const EditingStyle* style, |
| 225 EditingState* editing_state) { | 227 EditingState* editing_state) { |
| 226 ApplyCommandToComposite( | 228 ApplyCommandToComposite( |
| 227 ApplyStyleCommand::Create(GetDocument(), style, | 229 ApplyStyleCommand::Create(GetDocument(), style, |
| 228 InputEvent::InputType::kNone), | 230 InputEvent::InputType::kNone), |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1972 | 1974 |
| 1973 DEFINE_TRACE(CompositeEditCommand) { | 1975 DEFINE_TRACE(CompositeEditCommand) { |
| 1974 visitor->Trace(commands_); | 1976 visitor->Trace(commands_); |
| 1975 visitor->Trace(starting_selection_); | 1977 visitor->Trace(starting_selection_); |
| 1976 visitor->Trace(ending_selection_); | 1978 visitor->Trace(ending_selection_); |
| 1977 visitor->Trace(undo_step_); | 1979 visitor->Trace(undo_step_); |
| 1978 EditCommand::Trace(visitor); | 1980 EditCommand::Trace(visitor); |
| 1979 } | 1981 } |
| 1980 | 1982 |
| 1981 } // namespace blink | 1983 } // namespace blink |
| OLD | NEW |