Chromium Code Reviews| Index: views/controls/textfield/textfield.h |
| diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h |
| index 90c8139e4b00f3abcbe8e121a8b226b039987e4a..0dfb1b6bd5d7be68f82068517093e6e330412212 100644 |
| --- a/views/controls/textfield/textfield.h |
| +++ b/views/controls/textfield/textfield.h |
| @@ -69,9 +69,11 @@ class TextRange { |
| // Returns the max of selected range. |
| size_t GetMax() const; |
| - // Returns true if |range| has same start, end position. |
| - bool Equals(const TextRange& range) const { |
| - return start_ == range.start_ && end_ == range.end_; |
| + // Returns true if the selected text will be the same. |
|
Peter Kasting
2011/01/21 19:10:10
I think the functionality here is confusing. I'd
oshima
2011/01/21 20:05:01
moved empty check to caller, but i prefer to keep
|
| + // That is, if both range are empty, or both have same min and max; |
| + bool HasSameSelectionWith(const TextRange& range) const { |
| + return (is_empty() && range.is_empty()) || |
| + (GetMin() == range.GetMin() && GetMax() == range.GetMax()); |
| } |
| // Set the range with |start| and |end|. |