Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
|
yosin_UTC9
2016/05/19 08:32:36
Copyright text should be taken from FrameSelection
yoichio
2016/05/20 05:12:12
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef FrameCaret_h | |
| 6 #define FrameCaret_h | |
| 7 | |
| 8 #include "core/editing/CaretBase.h" | |
| 9 #include "core/editing/VisibleSelection.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class FrameCaret : public CaretBase { | |
| 14 public: | |
| 15 FrameCaret(LocalFrame*); | |
| 16 virtual ~FrameCaret() { } | |
|
yosin_UTC9
2016/05/19 08:32:36
Please put int .cpp as |FrameCaret::~FrameCaret()
yoichio
2016/05/20 05:12:12
Done.
| |
| 17 | |
| 18 // Used to suspend caret blinking while the mouse is down. | |
| 19 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; } | |
| 20 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } | |
| 21 void stopCaretBlinkTimer(); | |
| 22 void startBlinkCaret(); | |
| 23 | |
| 24 bool isCaretBoundsDirty() const { return m_caretRectDirty; } | |
| 25 void setCaretRectNeedsUpdate(); | |
| 26 void invalidateCaretRect(const VisibleSelection&); | |
| 27 | |
| 28 void paintCaret(GraphicsContext&, const LayoutPoint&, const VisibleSelection &); | |
| 29 | |
| 30 void dataWillChange(const CharacterData&); | |
| 31 void nodeWillBeRemoved(Node&); | |
| 32 | |
| 33 void prepareForDestruction(); | |
| 34 | |
| 35 // For unittests | |
| 36 bool shouldPaintCaretForTesting() const { return m_shouldPaintCaret; } | |
| 37 bool isPreviousCaretDirtyForTesting() const { return m_previousCaretNode; } | |
| 38 | |
| 39 DECLARE_VIRTUAL_TRACE(); | |
| 40 | |
| 41 private: | |
| 42 void caretBlinkTimerFired(Timer<FrameCaret>*); | |
| 43 | |
| 44 const Member<LocalFrame> m_frame; | |
| 45 // The last node which painted the caret. Retained for clearing the old | |
| 46 // caret when it moves. | |
| 47 Member<Node> m_previousCaretNode; | |
| 48 LayoutRect m_previousCaretRect; | |
| 49 CaretVisibility m_previousCaretVisibility; | |
| 50 Timer<FrameCaret> m_caretBlinkTimer; | |
| 51 bool m_caretRectDirty : 1; | |
| 52 bool m_shouldPaintCaret : 1; | |
| 53 bool m_isCaretBlinkingSuspended : 1; | |
| 54 }; | |
| 55 | |
| 56 } // namespace blink | |
| 57 | |
| 58 #endif // FrameCaret_h | |
| OLD | NEW |