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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.h

Issue 1994883002: [Editing][CodeHealth] Extract new FrameCaret class from FrameSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 7 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
Index: third_party/WebKit/Source/core/editing/FrameSelection.h
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.h b/third_party/WebKit/Source/core/editing/FrameSelection.h
index 5afe751b7df51492261e7eae6a2bd375ea9ab4a4..376d3cb91e0fb5a249f38bef4180a93dcb7ee6ab 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.h
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.h
@@ -47,6 +47,7 @@ class CharacterData;
class CullRect;
class LayoutBlock;
class LocalFrame;
+class FrameCaret;
class GranularityStrategy;
class GraphicsContext;
class HTMLFormElement;
@@ -182,15 +183,15 @@ public:
void commitAppearanceIfNeeded(LayoutView&);
void updateAppearance();
void setCaretVisible(bool caretIsVisible);
- bool isCaretBoundsDirty() const { return m_caretRectDirty; }
+ bool isCaretBoundsDirty() const;
void setCaretRectNeedsUpdate();
void scheduleVisualUpdate() const;
void invalidateCaretRect();
void paintCaret(GraphicsContext&, const LayoutPoint&);
// Used to suspend caret blinking while the mouse is down.
- void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; }
- bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; }
+ void setCaretBlinkingSuspended(bool);
+ bool isCaretBlinkingSuspended() const;
// Focus
void setFocused(bool);
@@ -272,9 +273,6 @@ private:
void focusedOrActiveStateChanged();
- void caretBlinkTimerFired(Timer<FrameSelection>*);
- void stopCaretBlinkTimer();
-
void setUseSecureKeyboardEntry(bool);
void setCaretVisibility(CaretVisibility);
@@ -288,8 +286,8 @@ private:
GranularityStrategy* granularityStrategy();
// For unittests
- bool shouldPaintCaretForTesting() const { return m_shouldPaintCaret; }
- bool isPreviousCaretDirtyForTesting() const { return m_previousCaretNode; }
+ bool shouldPaintCaretForTesting() const;
+ bool isPreviousCaretDirtyForTesting() const;
Member<LocalFrame> m_frame;
const Member<PendingSelection> m_pendingSelection;
@@ -301,24 +299,15 @@ private:
TextGranularity m_granularity;
LayoutUnit m_xPosForVerticalArrowNavigation;
- Member<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves.
- LayoutRect m_previousCaretRect;
- CaretVisibility m_previousCaretVisibility;
-
Member<EditingStyle> m_typingStyle;
- Timer<FrameSelection> m_caretBlinkTimer;
-
- bool m_caretRectDirty : 1;
- bool m_shouldPaintCaret : 1;
- bool m_isCaretBlinkingSuspended : 1;
bool m_focused : 1;
bool m_shouldShowBlockCursor : 1;
// Controls text granularity used to adjust the selection's extent in moveRangeSelectionExtent.
OwnPtr<GranularityStrategy> m_granularityStrategy;
- OwnPtr<CaretBase> m_caretBase;
+ const Member<FrameCaret> m_frameCaret;
};
inline EditingStyle* FrameSelection::typingStyle() const

Powered by Google App Engine
This is Rietveld 408576698