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

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

Issue 2201853002: Blink handle selection handle visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing nits and context menu 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/FrameSelection.h
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.h b/third_party/WebKit/Source/core/editing/FrameSelection.h
index b1bdf3800c54177e10d8f90591099e45e18d31c2..1f15b4164b5e6583360adaf03cdc4c083e9cd0d9 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.h
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.h
@@ -67,6 +67,8 @@ enum class SelectionDirectionalMode { NonDirectional, Directional };
enum class CaretVisibility;
+enum class HandleVisibility { NotVisible, Visible };
+
class CORE_EXPORT FrameSelection final
: public GarbageCollectedFinalized<FrameSelection> {
WTF_MAKE_NONCOPYABLE(FrameSelection);
@@ -86,6 +88,7 @@ class CORE_EXPORT FrameSelection final
DoNotUpdateAppearance = 1 << 4,
DoNotClearStrategy = 1 << 5,
DoNotAdjustInFlatTree = 1 << 6,
+ HandleVisible = 1 << 7,
};
// Union of values in SetSelectionOption and EUserTriggered
typedef unsigned SetSelectionOptions;
@@ -153,6 +156,7 @@ class CORE_EXPORT FrameSelection final
// the frame you entirely selected.
void selectFrameElementInParentIfFullySelected();
+ bool contains(const HitTestResult&);
bool contains(const LayoutPoint&);
SelectionType getSelectionType() const {
@@ -240,6 +244,10 @@ class CORE_EXPORT FrameSelection final
bool isFocusedAndActive() const;
void pageActivationChanged();
+ bool isHandleVisible() const {
+ return m_handleVisibility == HandleVisibility::Visible;
+ }
+
void updateSecureKeyboardEntryIfActive();
// Returns true if a word is selected.
@@ -256,7 +264,8 @@ class CORE_EXPORT FrameSelection final
void setNonDirectionalSelectionIfNeeded(
const VisibleSelectionInFlatTree&,
TextGranularity,
- EndPointsAdjustmentMode = DoNotAdjustEndpoints);
+ EndPointsAdjustmentMode = DoNotAdjustEndpoints,
+ HandleVisibility = HandleVisibility::NotVisible);
void setFocusedNodeIfNeeded();
void notifyLayoutObjectOfSelectionChange(EUserTriggered);
@@ -354,6 +363,8 @@ class CORE_EXPORT FrameSelection final
bool m_focused : 1;
+ HandleVisibility m_handleVisibility = HandleVisibility::NotVisible;
+
// Controls text granularity used to adjust the selection's extent in
// moveRangeSelectionExtent.
std::unique_ptr<GranularityStrategy> m_granularityStrategy;

Powered by Google App Engine
This is Rietveld 408576698