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

Unified Diff: third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h

Issue 2904093002: [DMC #18] Eliminate DocumentMarkerTextMatch (subclass of DocumentMarkerDetails) (Closed)
Patch Set: Created 3 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/markers/TextMatchMarker.h
diff --git a/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h b/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h
index 90422364f8f08295e7adfd64a3e4d6ed0e1b6ea1..c8daca02e9c4b7ff480c3d5e800ec8f0d41ae814 100644
--- a/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h
+++ b/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h
@@ -40,9 +40,15 @@ class TextMatchMarker final : public DocumentMarker {
TextMatchMarker(unsigned start_offset,
unsigned end_offset,
MatchStatus status)
- : DocumentMarker(start_offset, end_offset, status),
+ : DocumentMarker(DocumentMarker::kTextMatch, start_offset, end_offset),
+ status_(status),
state_(State::kInvalid) {}
+ bool IsActiveMatch() const { return status_ == MatchStatus::kActive; }
+ void SetIsActiveMatch(bool active) {
+ status_ = active ? MatchStatus::kActive : MatchStatus::kInactive;
+ }
+
bool IsRendered() const { return state_ == State::kValidNotNull; }
bool Contains(const LayoutPoint& point) const {
DCHECK_EQ(state_, State::kValidNotNull);
@@ -70,8 +76,7 @@ class TextMatchMarker final : public DocumentMarker {
bool IsValid() const { return state_ != State::kInvalid; }
private:
- explicit TextMatchMarker(const DocumentMarker& marker)
- : DocumentMarker(marker), state_(State::kInvalid) {}
+ MatchStatus status_;
yosin_UTC9 2017/05/26 04:39:47 nit: s/status_/match_status_/ It is confusing to
LayoutRect rendered_rect_;
State state_;

Powered by Google App Engine
This is Rietveld 408576698