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

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

Issue 1236823002: Move DragCaretController class to its own file (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-07-13T15:55:28 --similarity=30 Created 5 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 static LayoutBlock* caretLayoutObject(Node*); 68 static LayoutBlock* caretLayoutObject(Node*);
69 static void invalidateLocalCaretRect(Node*, const LayoutRect&); 69 static void invalidateLocalCaretRect(Node*, const LayoutRect&);
70 70
71 private: 71 private:
72 LayoutBlock* m_caretPainter; // layout object responsible for painting the c aret 72 LayoutBlock* m_caretPainter; // layout object responsible for painting the c aret
73 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje ct responsible for painting the caret 73 LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObje ct responsible for painting the caret
74 CaretVisibility m_caretVisibility; 74 CaretVisibility m_caretVisibility;
75 }; 75 };
76 76
77 class DragCaretController final : public NoBaseWillBeGarbageCollected<DragCaretC ontroller>, private CaretBase {
78 WTF_MAKE_NONCOPYABLE(DragCaretController);
79 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DragCaretController);
80 public:
81 static PassOwnPtrWillBeRawPtr<DragCaretController> create();
82
83 LayoutBlock* caretLayoutObject() const { return CaretBase::caretPainter(); }
84 void paintDragCaret(LocalFrame*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
85
86 bool isContentEditable() const { return m_position.rootEditableElement(); }
87 bool isContentRichlyEditable() const;
88
89 bool hasCaret() const { return m_position.isNotNull(); }
90 const VisiblePosition& caretPosition() { return m_position; }
91 void setCaretPosition(const VisiblePosition&);
92 void clear() { setCaretPosition(VisiblePosition()); }
93
94 void nodeWillBeRemoved(Node&);
95
96 DECLARE_TRACE();
97
98 private:
99 DragCaretController();
100
101 VisiblePosition m_position;
102 };
103
104 } // namespace blink 77 } // namespace blink
105 78
106
107 #endif // Caret_h 79 #endif // Caret_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698