| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef DragCaretController_h | 26 #ifndef DragCaretController_h |
| 27 #define DragCaretController_h | 27 #define DragCaretController_h |
| 28 | 28 |
| 29 #include "core/editing/CaretBase.h" | 29 #include "core/editing/CaretBase.h" |
| 30 | 30 |
| 31 #include <memory> | |
| 32 | |
| 33 namespace blink { | 31 namespace blink { |
| 34 | 32 |
| 35 class DragCaretController final : public GarbageCollectedFinalized<DragCaretCont
roller> { | 33 class DragCaretController final : public GarbageCollectedFinalized<DragCaretCont
roller> { |
| 36 WTF_MAKE_NONCOPYABLE(DragCaretController); | 34 WTF_MAKE_NONCOPYABLE(DragCaretController); |
| 37 public: | 35 public: |
| 38 static DragCaretController* create(); | 36 static DragCaretController* create(); |
| 39 | 37 |
| 40 LayoutBlock* caretLayoutObject() const; | 38 LayoutBlock* caretLayoutObject() const; |
| 41 void paintDragCaret(LocalFrame*, GraphicsContext&, const LayoutPoint&) const
; | 39 void paintDragCaret(LocalFrame*, GraphicsContext&, const LayoutPoint&) const
; |
| 42 | 40 |
| 43 bool isContentEditable() const; | 41 bool isContentEditable() const; |
| 44 bool isContentRichlyEditable() const; | 42 bool isContentRichlyEditable() const; |
| 45 | 43 |
| 46 bool hasCaret() const { return m_position.isNotNull(); } | 44 bool hasCaret() const { return m_position.isNotNull(); } |
| 47 const VisiblePosition& caretPosition() { return m_position; } | 45 const VisiblePosition& caretPosition() { return m_position; } |
| 48 void setCaretPosition(const PositionWithAffinity&); | 46 void setCaretPosition(const PositionWithAffinity&); |
| 49 void clear() { setCaretPosition(PositionWithAffinity()); } | 47 void clear() { setCaretPosition(PositionWithAffinity()); } |
| 50 | 48 |
| 51 void nodeWillBeRemoved(Node&); | 49 void nodeWillBeRemoved(Node&); |
| 52 | 50 |
| 53 DECLARE_TRACE(); | 51 DECLARE_TRACE(); |
| 54 | 52 |
| 55 private: | 53 private: |
| 56 DragCaretController(); | 54 DragCaretController(); |
| 57 | 55 |
| 58 VisiblePosition m_position; | 56 VisiblePosition m_position; |
| 59 const std::unique_ptr<CaretBase> m_caretBase; | 57 const Member<CaretBase> m_caretBase; |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 } // namespace blink | 60 } // namespace blink |
| 63 | 61 |
| 64 #endif // DragCaretController_h | 62 #endif // DragCaretController_h |
| OLD | NEW |