summaryrefslogtreecommitdiffstats
path: root/ui/base/range/range.h
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 02:29:59 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 02:29:59 +0000
commite571a9a61650c028318b6cf1ac7e2f9281a87712 (patch)
tree0fe3fc9b81ed83a5d9fc22b5c8950c5f3cbfdf7e /ui/base/range/range.h
parentc9fa1a726cc4fb385f77ff97731b7bc4edf81ff2 (diff)
downloadchromium_src-e571a9a61650c028318b6cf1ac7e2f9281a87712.zip
chromium_src-e571a9a61650c028318b6cf1ac7e2f9281a87712.tar.gz
chromium_src-e571a9a61650c028318b6cf1ac7e2f9281a87712.tar.bz2
Contains/Intersects methods for ui::Range
This will be used to implement text style/coloring for TextfieldViews. BUG=none TEST=new unit tests are added in range_unittests.cc Review URL: http://codereview.chromium.org/7039051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/range/range.h')
-rw-r--r--ui/base/range/range.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/base/range/range.h b/ui/base/range/range.h
index a0614d0..c1ddaf5 100644
--- a/ui/base/range/range.h
+++ b/ui/base/range/range.h
@@ -79,6 +79,16 @@ class Range {
bool operator!=(const Range& other) const;
bool EqualsIgnoringDirection(const Range& other) const;
+ // Returns true if this range intersects the specified |range|.
+ bool Intersects(const Range& range) const;
+
+ // Returns true if this range contains the specified |range|.
+ bool Contains(const Range& range) const;
+
+ // Computes the intersection of this range with the given |range|.
+ // If they don't intersects, it returns an InvalidRange().
+ Range Intersect(const Range& range) const;
+
#if defined(OS_MACOSX)
Range& operator=(const NSRange& range);