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

Side by Side Diff: views/controls/textfield/text_range.cc

Issue 6628037: views: Moves TextfieldController/TextRange into their own headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/controls/textfield/text_range.h"
6
7 #include <algorithm>
8
9 namespace views {
10
11 TextRange::TextRange()
12 : start_(0), end_(0) {
13 }
14
15 TextRange::TextRange(size_t start, size_t end)
16 : start_(start), end_(end) {
17 }
18
19 TextRange::TextRange(const TextRange& range)
20 : start_(range.start_), end_(range.end_) {
21 }
22
23 size_t TextRange::GetMin() const {
24 return std::min(start_, end_);
25 }
26
27 size_t TextRange::GetMax() const {
28 return std::max(start_, end_);
29 }
30 bool TextRange::EqualsIgnoringDirection(const TextRange& range) const {
31 return GetMin() == range.GetMin() && GetMax() == range.GetMax();
32 }
33
34 void TextRange::SetRange(size_t start, size_t end) {
35 start_ = start;
36 end_ = end;
37 }
38
39 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698