OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 | 26 |
27 #ifndef TextMatchMarker_h | 27 #ifndef TextMatchMarker_h |
28 #define TextMatchMarker_h | 28 #define TextMatchMarker_h |
29 | 29 |
30 #include "core/editing/markers/DocumentMarker.h" | 30 #include "core/editing/markers/DocumentMarker.h" |
31 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
| 35 // A subclass of DocumentMarker used to store information specific to TextMatch |
| 36 // markers. We store whether or not the match is active, a LayoutRect used for |
| 37 // rendering the marker, and whether or not the LayoutRect is currently |
| 38 // up-to-date. |
35 class TextMatchMarker final : public DocumentMarker { | 39 class TextMatchMarker final : public DocumentMarker { |
36 private: | 40 private: |
37 enum class State { kInvalid, kValidNull, kValidNotNull }; | 41 enum class State { kInvalid, kValidNull, kValidNotNull }; |
38 | 42 |
39 public: | 43 public: |
40 TextMatchMarker(unsigned start_offset, | 44 TextMatchMarker(unsigned start_offset, |
41 unsigned end_offset, | 45 unsigned end_offset, |
42 MatchStatus status) | 46 MatchStatus status) |
43 : DocumentMarker(DocumentMarker::kTextMatch, start_offset, end_offset), | 47 : DocumentMarker(DocumentMarker::kTextMatch, start_offset, end_offset), |
44 match_status_(status) { | 48 match_status_(status) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 88 |
85 DEFINE_TYPE_CASTS(TextMatchMarker, | 89 DEFINE_TYPE_CASTS(TextMatchMarker, |
86 DocumentMarker, | 90 DocumentMarker, |
87 marker, | 91 marker, |
88 marker->GetType() == DocumentMarker::kTextMatch, | 92 marker->GetType() == DocumentMarker::kTextMatch, |
89 marker.GetType() == DocumentMarker::kTextMatch); | 93 marker.GetType() == DocumentMarker::kTextMatch); |
90 | 94 |
91 } // namespace blink | 95 } // namespace blink |
92 | 96 |
93 #endif | 97 #endif |
OLD | NEW |