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

Unified Diff: views/controls/textfield/textfield.h

Issue 6266015: Fix range comparison. Get space to accept keyword work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 11 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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|.
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698