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

Unified Diff: ui/gfx/selection_model.h

Issue 8044004: Clean up of SelectionModel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: add comment about 'next' in ReplaceTextInternal Created 9 years, 2 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 | « ui/gfx/render_text.cc ('k') | ui/gfx/selection_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/selection_model.h
===================================================================
--- ui/gfx/selection_model.h (revision 103984)
+++ ui/gfx/selection_model.h (working copy)
@@ -49,31 +49,30 @@
SelectionModel();
explicit SelectionModel(size_t pos);
- SelectionModel(size_t start, size_t end);
SelectionModel(size_t end, size_t pos, CaretPlacement status);
SelectionModel(size_t start, size_t end, size_t pos, CaretPlacement status);
virtual ~SelectionModel();
size_t selection_start() const { return selection_start_; }
- void set_selection_start(size_t pos) { selection_start_ = pos; }
-
size_t selection_end() const { return selection_end_; }
- void set_selection_end(size_t pos) { selection_end_ = pos; }
-
size_t caret_pos() const { return caret_pos_; }
- void set_caret_pos(size_t pos) { caret_pos_ = pos; }
-
CaretPlacement caret_placement() const { return caret_placement_; }
- void set_caret_placement(CaretPlacement placement) {
- caret_placement_ = placement;
- }
bool Equals(const SelectionModel& sel) const;
private:
+ friend class RenderText;
+
void Init(size_t start, size_t end, size_t pos, CaretPlacement status);
+ void set_selection_start(size_t pos) { selection_start_ = pos; }
+ void set_selection_end(size_t pos) { selection_end_ = pos; }
+ void set_caret_pos(size_t pos) { caret_pos_ = pos; }
+ void set_caret_placement(CaretPlacement placement) {
+ caret_placement_ = placement;
+ }
+
// Logical selection start. If there is non-empty selection, if
// selection_start_ is less than selection_end_, the selection starts visually
// at the leading edge of the selection_start_. If selection_start_ is greater
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/selection_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698