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

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

Issue 2441573002: Move setNonDirectionalSelectionIfNeeded() to SelectionController from FrameSelection (Closed)
Patch Set: 2016-10-24T17:02:54 Created 4 years, 2 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/SelectionController.h
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.h b/third_party/WebKit/Source/core/editing/SelectionController.h
index 30eb0d352675a08b0fe5711f1933825c404828e1..c66633aa7f50bccca936394251f8cd5b43594f0c 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.h
+++ b/third_party/WebKit/Source/core/editing/SelectionController.h
@@ -39,13 +39,15 @@ class FrameSelection;
class HitTestResult;
class LocalFrame;
-class SelectionController final : public GarbageCollected<SelectionController> {
+class CORE_EXPORT SelectionController final
+ : public GarbageCollectedFinalized<SelectionController> {
WTF_MAKE_NONCOPYABLE(SelectionController);
public:
static SelectionController* create(LocalFrame&);
DECLARE_TRACE();
+ void documentDetached();
void handleMousePressEvent(const MouseEventWithHitTestResults&);
bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
@@ -80,10 +82,18 @@ class SelectionController final : public GarbageCollected<SelectionController> {
}
private:
+ friend class SelectionControllerTest;
+
explicit SelectionController(LocalFrame&);
enum class AppendTrailingWhitespace { ShouldAppend, DontAppend };
enum class SelectInputEventType { Touch, Mouse };
+ enum EndPointsAdjustmentMode {
+ AdjustEndpointsAtBidiBoundary,
+ DoNotAdjustEndpoints
+ };
+
+ Document& document() const;
void selectClosestWordFromHitTestResult(const HitTestResult&,
AppendTrailingWhitespace,
@@ -95,6 +105,9 @@ class SelectionController final : public GarbageCollected<SelectionController> {
const MouseEventWithHitTestResults&);
void selectClosestWordOrLinkFromMouseEvent(
const MouseEventWithHitTestResults&);
+ void setNonDirectionalSelectionIfNeeded(const VisibleSelectionInFlatTree&,
+ TextGranularity,
+ EndPointsAdjustmentMode);
bool updateSelectionForMouseDownDispatchingSelectStart(
Node*,
const VisibleSelectionInFlatTree&,
@@ -103,6 +116,10 @@ class SelectionController final : public GarbageCollected<SelectionController> {
FrameSelection& selection() const;
Member<LocalFrame> const m_frame;
+ // TODO(yosin): We should use |PositionWIthAffinityInFlatTree| since we
+ // should reduce usage of |VisibleSelectionInFlatTree|.
+ // Used to store base before the adjustment at bidi boundary
+ VisiblePositionInFlatTree m_originalBaseInFlatTree;
bool m_mouseDownMayStartSelect;
bool m_mouseDownWasSingleClickInSelection;
bool m_mouseDownAllowsMultiClick;

Powered by Google App Engine
This is Rietveld 408576698