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

Side by Side Diff: ui/gfx/selection_model.h

Issue 1671403002: Switch gfx::Range to use uint32_t instead of size_t. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 10 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
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_SELECTION_MODEL_H_ 5 #ifndef UI_GFX_SELECTION_MODEL_H_
6 #define UI_GFX_SELECTION_MODEL_H_ 6 #define UI_GFX_SELECTION_MODEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Create a SelectionModel representing a selection (which may be empty). 70 // Create a SelectionModel representing a selection (which may be empty).
71 // The caret position is the end of the range. 71 // The caret position is the end of the range.
72 SelectionModel(const Range& selection, LogicalCursorDirection affinity); 72 SelectionModel(const Range& selection, LogicalCursorDirection affinity);
73 73
74 const Range& selection() const { return selection_; } 74 const Range& selection() const { return selection_; }
75 size_t caret_pos() const { return selection_.end(); } 75 size_t caret_pos() const { return selection_.end(); }
76 LogicalCursorDirection caret_affinity() const { return caret_affinity_; } 76 LogicalCursorDirection caret_affinity() const { return caret_affinity_; }
77 77
78 // WARNING: Generally the selection start should not be changed without 78 // WARNING: Generally the selection start should not be changed without
79 // considering the effect on the caret affinity. 79 // considering the effect on the caret affinity.
80 void set_selection_start(size_t pos) { selection_.set_start(pos); } 80 void set_selection_start(uint32_t pos) { selection_.set_start(pos); }
81 81
82 bool operator==(const SelectionModel& sel) const; 82 bool operator==(const SelectionModel& sel) const;
83 bool operator!=(const SelectionModel& sel) const { return !(*this == sel); } 83 bool operator!=(const SelectionModel& sel) const { return !(*this == sel); }
84 84
85 std::string ToString() const; 85 std::string ToString() const;
86 86
87 private: 87 private:
88 // Logical selection. The logical caret position is the end of the selection. 88 // Logical selection. The logical caret position is the end of the selection.
89 Range selection_; 89 Range selection_;
90 90
(...skipping 12 matching lines...) Expand all
103 // 3 abc|FED abcFED| 103 // 3 abc|FED abcFED|
104 // 4 abcFE|D abcFE|D 104 // 4 abcFE|D abcFE|D
105 // 5 abcF|ED abcF|ED 105 // 5 abcF|ED abcF|ED
106 // 6 abc|FED abcFED| 106 // 6 abc|FED abcFED|
107 LogicalCursorDirection caret_affinity_; 107 LogicalCursorDirection caret_affinity_;
108 }; 108 };
109 109
110 } // namespace gfx 110 } // namespace gfx
111 111
112 #endif // UI_GFX_SELECTION_MODEL_H_ 112 #endif // UI_GFX_SELECTION_MODEL_H_
OLDNEW
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698