Remove RenderText::MoveCursorTo gfx::Point helper.
Move the helper function implementation to TextfieldModel.
Make SelectionModel::set_selection_start public.
(a simple note to consider affinity is sufficient warning)
Misc cleanup changes.
BUG=NONE
TEST=No changes in touch/mouse textfield/omnibox behavior on views.
[email protected],[email protected]
Review URL: https://codereview.chromium.org/268543010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268770 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/selection_model.h b/ui/gfx/selection_model.h
index d509e89..356416d 100644
--- a/ui/gfx/selection_model.h
+++ b/ui/gfx/selection_model.h
@@ -73,19 +73,16 @@
size_t caret_pos() const { return selection_.end(); }
LogicalCursorDirection caret_affinity() const { return caret_affinity_; }
+ // WARNING: Generally the selection start should not be changed without
+ // considering the effect on the caret affinity.
+ void set_selection_start(size_t pos) { selection_.set_start(pos); }
+
bool operator==(const SelectionModel& sel) const;
bool operator!=(const SelectionModel& sel) const { return !(*this == sel); }
std::string ToString() const;
private:
- friend class RenderText;
-
- // TODO(benrg): Generally the selection start should not be changed without
- // considering the effect on the caret affinity. This setter is exposed only
- // to RenderText to discourage misuse, and should probably be removed.
- void set_selection_start(size_t pos) { selection_.set_start(pos); }
-
// Logical selection. The logical caret position is the end of the selection.
Range selection_;