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

Unified Diff: Source/core/editing/GranularityStrategy.h

Issue 1123563003: Improving direction-based selection strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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: Source/core/editing/GranularityStrategy.h
diff --git a/Source/core/editing/GranularityStrategy.h b/Source/core/editing/GranularityStrategy.h
index 9d31bc84eb0ad41f48f7a04ea2fa49f2e994b75c..72763d0b771c8cda62cd635ce9a01b51cf64f441 100644
--- a/Source/core/editing/GranularityStrategy.h
+++ b/Source/core/editing/GranularityStrategy.h
@@ -18,7 +18,7 @@ public:
// Calculates and returns the new selection based on the updated user
// selection extent |extentPosition| and the granularity strategy.
- virtual VisibleSelection updateExtent(const VisiblePosition& extentPosition, const VisibleSelection&) = 0;
+ virtual VisibleSelection updateExtent(const IntPoint&, LocalFrame*) = 0;
protected:
GranularityStrategy();
@@ -33,7 +33,7 @@ public:
// GranularityStrategy:
SelectionStrategy GetType() const final;
void Clear() final;
- VisibleSelection updateExtent(const VisiblePosition& extentPosition, const VisibleSelection&) final;
+ VisibleSelection updateExtent(const IntPoint&, LocalFrame*) final;
};
// "Expand by word, shrink by character" selection strategy.
@@ -48,7 +48,7 @@ public:
// GranularityStrategy:
SelectionStrategy GetType() const final;
void Clear() final;
- VisibleSelection updateExtent(const VisiblePosition&, const VisibleSelection&) final;
+ VisibleSelection updateExtent(const IntPoint&, LocalFrame*) final;
private:
enum class BoundAdjust {CurrentPosIfOnBound, NextBoundIfOnBound};
@@ -65,6 +65,8 @@ private:
// Set to true if the selection was shrunk (without changing relative
// base/extent order) as a result of the most recent updateExtent call.
bool m_lastMoveShrunkSelection;
+ IntPoint m_extentPoint;
+ int m_offset;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698