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

Side by Side Diff: Source/core/editing/DeleteSelectionCommand.h

Issue 23822003: Have EditCommand classes deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 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 16 matching lines...) Expand all
27 #define DeleteSelectionCommand_h 27 #define DeleteSelectionCommand_h
28 28
29 #include "core/editing/CompositeEditCommand.h" 29 #include "core/editing/CompositeEditCommand.h"
30 30
31 namespace WebCore { 31 namespace WebCore {
32 32
33 class EditingStyle; 33 class EditingStyle;
34 34
35 class DeleteSelectionCommand : public CompositeEditCommand { 35 class DeleteSelectionCommand : public CompositeEditCommand {
36 public: 36 public:
37 static PassRefPtr<DeleteSelectionCommand> create(Document* document, bool sm artDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, boo l expandForSpecialElements = false, bool sanitizeMarkup = true) 37 static PassRefPtr<DeleteSelectionCommand> create(Document& document, bool sm artDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, boo l expandForSpecialElements = false, bool sanitizeMarkup = true)
38 { 38 {
39 return adoptRef(new DeleteSelectionCommand(document, smartDelete, mergeB locksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup)); 39 return adoptRef(new DeleteSelectionCommand(document, smartDelete, mergeB locksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
40 } 40 }
41 static PassRefPtr<DeleteSelectionCommand> create(const VisibleSelection& sel ection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool repla ce = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true) 41 static PassRefPtr<DeleteSelectionCommand> create(const VisibleSelection& sel ection, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool repla ce = false, bool expandForSpecialElements = false, bool sanitizeMarkup = true)
42 { 42 {
43 return adoptRef(new DeleteSelectionCommand(selection, smartDelete, merge BlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup)); 43 return adoptRef(new DeleteSelectionCommand(selection, smartDelete, merge BlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
44 } 44 }
45 45
46 private: 46 private:
47 DeleteSelectionCommand(Document*, bool smartDelete, bool mergeBlocksAfterDel ete, bool replace, bool expandForSpecialElements, bool santizeMarkup); 47 DeleteSelectionCommand(Document&, bool smartDelete, bool mergeBlocksAfterDel ete, bool replace, bool expandForSpecialElements, bool santizeMarkup);
48 DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool merge BlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMar kup); 48 DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool merge BlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMar kup);
49 49
50 virtual void doApply(); 50 virtual void doApply();
51 virtual EditAction editingAction() const; 51 virtual EditAction editingAction() const;
52 52
53 virtual bool preservesTypingStyle() const; 53 virtual bool preservesTypingStyle() const;
54 54
55 void initializeStartEnd(Position&, Position&); 55 void initializeStartEnd(Position&, Position&);
56 void setStartingSelectionOnSmartDelete(const Position&, const Position&); 56 void setStartingSelectionOnSmartDelete(const Position&, const Position&);
57 void initializePositionData(); 57 void initializePositionData();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 RefPtr<Node> m_startRoot; 96 RefPtr<Node> m_startRoot;
97 RefPtr<Node> m_endRoot; 97 RefPtr<Node> m_endRoot;
98 RefPtr<Node> m_startTableRow; 98 RefPtr<Node> m_startTableRow;
99 RefPtr<Node> m_endTableRow; 99 RefPtr<Node> m_endTableRow;
100 RefPtr<Node> m_temporaryPlaceholder; 100 RefPtr<Node> m_temporaryPlaceholder;
101 }; 101 };
102 102
103 } // namespace WebCore 103 } // namespace WebCore
104 104
105 #endif // DeleteSelectionCommand_h 105 #endif // DeleteSelectionCommand_h
OLDNEW
« no previous file with comments | « Source/core/editing/DeleteFromTextNodeCommand.cpp ('k') | Source/core/editing/DeleteSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698