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

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

Issue 2110543008: Move UndoStack from Page to Editor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void replaceSelectionWithFragment(DocumentFragment*, bool selectReplacement, bool smartReplace, bool matchStyle); 226 void replaceSelectionWithFragment(DocumentFragment*, bool selectReplacement, bool smartReplace, bool matchStyle);
227 void replaceSelectionWithText(const String&, bool selectReplacement, bool sm artReplace); 227 void replaceSelectionWithText(const String&, bool selectReplacement, bool sm artReplace);
228 228
229 // TODO(xiaochengh): Replace |bool| parameters by |enum|. 229 // TODO(xiaochengh): Replace |bool| parameters by |enum|.
230 void replaceSelectionAfterDragging(DocumentFragment*, bool smartReplace, boo l plainText); 230 void replaceSelectionAfterDragging(DocumentFragment*, bool smartReplace, boo l plainText);
231 void moveSelectionAfterDragging(DocumentFragment*, const Position&, bool sma rtInsert, bool smartDelete); 231 void moveSelectionAfterDragging(DocumentFragment*, const Position&, bool sma rtInsert, bool smartDelete);
232 232
233 EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaul tParagraphSeparator; } 233 EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaul tParagraphSeparator; }
234 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_de faultParagraphSeparator = separator; } 234 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_de faultParagraphSeparator = separator; }
235 235
236 UndoStack& undoStack() const;
237
236 static void tidyUpHTMLStructure(Document&); 238 static void tidyUpHTMLStructure(Document&);
237 239
238 class RevealSelectionScope { 240 class RevealSelectionScope {
239 WTF_MAKE_NONCOPYABLE(RevealSelectionScope); 241 WTF_MAKE_NONCOPYABLE(RevealSelectionScope);
240 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 242 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
241 public: 243 public:
242 explicit RevealSelectionScope(Editor*); 244 explicit RevealSelectionScope(Editor*);
243 ~RevealSelectionScope(); 245 ~RevealSelectionScope();
244 246
245 DECLARE_TRACE(); 247 DECLARE_TRACE();
246 private: 248 private:
247 Member<Editor> m_editor; 249 Member<Editor> m_editor;
248 }; 250 };
249 friend class RevealSelectionScope; 251 friend class RevealSelectionScope;
250 252
251 DECLARE_TRACE(); 253 DECLARE_TRACE();
252 254
253 private: 255 private:
254 Member<LocalFrame> m_frame; 256 Member<LocalFrame> m_frame;
255 Member<CompositeEditCommand> m_lastEditCommand; 257 Member<CompositeEditCommand> m_lastEditCommand;
258 Member<UndoStack> m_undoStack;
256 int m_preventRevealSelection; 259 int m_preventRevealSelection;
257 bool m_shouldStartNewKillRingSequence; 260 bool m_shouldStartNewKillRingSequence;
258 bool m_shouldStyleWithCSS; 261 bool m_shouldStyleWithCSS;
259 const std::unique_ptr<KillRing> m_killRing; 262 const std::unique_ptr<KillRing> m_killRing;
260 VisibleSelection m_mark; 263 VisibleSelection m_mark;
261 bool m_areMarkedTextMatchesHighlighted; 264 bool m_areMarkedTextMatchesHighlighted;
262 EditorParagraphSeparator m_defaultParagraphSeparator; 265 EditorParagraphSeparator m_defaultParagraphSeparator;
263 bool m_overwriteModeEnabled; 266 bool m_overwriteModeEnabled;
264 267
265 explicit Editor(LocalFrame&); 268 explicit Editor(LocalFrame&);
266 269
267 LocalFrame& frame() const 270 LocalFrame& frame() const
268 { 271 {
269 DCHECK(m_frame); 272 DCHECK(m_frame);
270 return *m_frame; 273 return *m_frame;
271 } 274 }
272 275
273 bool canDeleteRange(const EphemeralRange&) const; 276 bool canDeleteRange(const EphemeralRange&) const;
274 bool shouldDeleteRange(const EphemeralRange&) const; 277 bool shouldDeleteRange(const EphemeralRange&) const;
275 278
276 UndoStack* undoStack() const;
277
278 bool tryDHTMLCopy(); 279 bool tryDHTMLCopy();
279 bool tryDHTMLCut(); 280 bool tryDHTMLCut();
280 bool tryDHTMLPaste(PasteMode); 281 bool tryDHTMLPaste(PasteMode);
281 282
282 bool canSmartReplaceWithPasteboard(Pasteboard*); 283 bool canSmartReplaceWithPasteboard(Pasteboard*);
283 void pasteAsPlainTextWithPasteboard(Pasteboard*); 284 void pasteAsPlainTextWithPasteboard(Pasteboard*);
284 void pasteWithPasteboard(Pasteboard*); 285 void pasteWithPasteboard(Pasteboard*);
285 void writeSelectionToPasteboard(); 286 void writeSelectionToPasteboard();
286 bool dispatchCPPEvent(const AtomicString&, DataTransferAccessPolicy, PasteMo de = AllMimeTypes); 287 bool dispatchCPPEvent(const AtomicString&, DataTransferAccessPolicy, PasteMo de = AllMimeTypes);
287 288
(...skipping 26 matching lines...) Expand all
314 315
315 inline bool Editor::markedTextMatchesAreHighlighted() const 316 inline bool Editor::markedTextMatchesAreHighlighted() const
316 { 317 {
317 return m_areMarkedTextMatchesHighlighted; 318 return m_areMarkedTextMatchesHighlighted;
318 } 319 }
319 320
320 321
321 } // namespace blink 322 } // namespace blink
322 323
323 #endif // Editor_h 324 #endif // Editor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698