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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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/touch_selection/ui_touch_selection_export.h ('k') | ui/views/touchui/touch_selection_controller_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index aa1ebfd596c92bf653abaea5b5010c873b1ee2db..eb1630696c7df78176b92a91cbd0cfab8f4681ad 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -12,6 +12,7 @@
#include "ui/base/cursor/cursor.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/drag_utils.h"
+#include "ui/base/touch/selection_bound.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/events/event.h"
@@ -1110,10 +1111,8 @@ void Textfield::GetSelectionEndPoints(ui::SelectionBound* anchor,
gfx::Rect r1 = render_text->GetCursorBounds(start_sel, true);
gfx::Rect r2 = render_text->GetCursorBounds(sel, true);
- anchor->edge_top = r1.origin();
- anchor->edge_bottom = r1.bottom_left();
- focus->edge_top = r2.origin();
- focus->edge_bottom = r2.bottom_left();
+ anchor->SetEdge(r1.origin(), r1.bottom_left());
+ focus->SetEdge(r2.origin(), r2.bottom_left());
// Determine the SelectionBound's type for focus and anchor.
// TODO(mfomitchev): Ideally we should have different logical directions for
@@ -1123,14 +1122,15 @@ void Textfield::GetSelectionEndPoints(ui::SelectionBound* anchor,
size_t focus_position_index = sel.selection().end();
if (anchor_position_index == focus_position_index) {
- anchor->type = focus->type = ui::SelectionBound::CENTER;
+ anchor->set_type(ui::SelectionBound::CENTER);
+ focus->set_type(ui::SelectionBound::CENTER);
} else if ((ltr && anchor_position_index < focus_position_index) ||
(!ltr && anchor_position_index > focus_position_index)) {
- anchor->type = ui::SelectionBound::LEFT;
- focus->type = ui::SelectionBound::RIGHT;
+ anchor->set_type(ui::SelectionBound::LEFT);
+ focus->set_type(ui::SelectionBound::RIGHT);
} else {
- anchor->type = ui::SelectionBound::RIGHT;
- focus->type = ui::SelectionBound::LEFT;
+ anchor->set_type(ui::SelectionBound::RIGHT);
+ focus->set_type(ui::SelectionBound::LEFT);
}
}
« no previous file with comments | « ui/touch_selection/ui_touch_selection_export.h ('k') | ui/views/touchui/touch_selection_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698