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

Unified Diff: Source/core/editing/DragCaretController.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-13T18:52:16 Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/Caret.cpp ('k') | Source/core/editing/DragCaretController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DragCaretController.h
diff --git a/Source/core/editing/DragCaretController.h b/Source/core/editing/DragCaretController.h
index e26a98c8ea0b4c2994f18add7decd7bd3b723181..c48c8046b704cee3b8972ed7aa6cc7c077fa4718 100644
--- a/Source/core/editing/DragCaretController.h
+++ b/Source/core/editing/DragCaretController.h
@@ -26,54 +26,10 @@
#ifndef DragCaretController_h
#define DragCaretController_h
-#include "core/CoreExport.h"
-#include "core/editing/VisiblePosition.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/geometry/LayoutRect.h"
-#include "wtf/Noncopyable.h"
+#include "core/editing/Caret.h"
namespace blink {
-class LocalFrame;
-class GraphicsContext;
-class LayoutBlock;
-class LayoutView;
-
-class CORE_EXPORT CaretBase {
- WTF_MAKE_NONCOPYABLE(CaretBase);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CaretBase);
-protected:
- enum CaretVisibility { Visible, Hidden };
- explicit CaretBase(CaretVisibility = Hidden);
-
- void invalidateCaretRect(Node*, bool caretRectChanged = false);
- void clearCaretRect();
- // Creating VisiblePosition causes synchronous layout so we should use the
- // PositionWithAffinity version if possible.
- // A position in HTMLTextFromControlElement is a typical example.
- bool updateCaretRect(Document*, const PositionWithAffinity& caretPosition);
- bool updateCaretRect(Document*, const VisiblePosition& caretPosition);
- IntRect absoluteBoundsForLocalRect(Node*, const LayoutRect&) const;
- bool shouldRepaintCaret(Node&) const;
- bool shouldRepaintCaret(const LayoutView*) const;
- void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
-
- const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalRect; }
- LayoutBlock* caretPainter() const { return m_caretPainter; }
-
- void setCaretVisibility(CaretVisibility visibility) { m_caretVisibility = visibility; }
- bool caretIsVisible() const { return m_caretVisibility == Visible; }
- CaretVisibility caretVisibility() const { return m_caretVisibility; }
-
- static LayoutBlock* caretLayoutObject(Node*);
- static void invalidateLocalCaretRect(Node*, const LayoutRect&);
-
-private:
- LayoutBlock* m_caretPainter; // layout object responsible for painting the caret
- LayoutRect m_caretLocalRect; // caret rect in coords local to the layoutObject responsible for painting the caret
- CaretVisibility m_caretVisibility;
-};
-
class DragCaretController final : public NoBaseWillBeGarbageCollected<DragCaretController>, private CaretBase {
WTF_MAKE_NONCOPYABLE(DragCaretController);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DragCaretController);
@@ -103,5 +59,4 @@ private:
} // namespace blink
-
#endif // DragCaretController_h
« no previous file with comments | « Source/core/editing/Caret.cpp ('k') | Source/core/editing/DragCaretController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698