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

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

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-event: mandol_line Created 5 years, 1 month 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
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 #include "ui/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1150
1151 void Textfield::GetSelectionEndPoints(ui::SelectionBound* anchor, 1151 void Textfield::GetSelectionEndPoints(ui::SelectionBound* anchor,
1152 ui::SelectionBound* focus) { 1152 ui::SelectionBound* focus) {
1153 gfx::RenderText* render_text = GetRenderText(); 1153 gfx::RenderText* render_text = GetRenderText();
1154 const gfx::SelectionModel& sel = render_text->selection_model(); 1154 const gfx::SelectionModel& sel = render_text->selection_model();
1155 gfx::SelectionModel start_sel = 1155 gfx::SelectionModel start_sel =
1156 render_text->GetSelectionModelForSelectionStart(); 1156 render_text->GetSelectionModelForSelectionStart();
1157 gfx::Rect r1 = render_text->GetCursorBounds(start_sel, true); 1157 gfx::Rect r1 = render_text->GetCursorBounds(start_sel, true);
1158 gfx::Rect r2 = render_text->GetCursorBounds(sel, true); 1158 gfx::Rect r2 = render_text->GetCursorBounds(sel, true);
1159 1159
1160 anchor->SetEdge(r1.origin(), r1.bottom_left()); 1160 anchor->SetEdge(gfx::PointF(r1.origin()), gfx::PointF(r1.bottom_left()));
1161 focus->SetEdge(r2.origin(), r2.bottom_left()); 1161 focus->SetEdge(gfx::PointF(r2.origin()), gfx::PointF(r2.bottom_left()));
1162 1162
1163 // Determine the SelectionBound's type for focus and anchor. 1163 // Determine the SelectionBound's type for focus and anchor.
1164 // TODO(mfomitchev): Ideally we should have different logical directions for 1164 // TODO(mfomitchev): Ideally we should have different logical directions for
1165 // start and end to support proper handle direction for mixed LTR/RTL text. 1165 // start and end to support proper handle direction for mixed LTR/RTL text.
1166 const bool ltr = GetTextDirection() != base::i18n::RIGHT_TO_LEFT; 1166 const bool ltr = GetTextDirection() != base::i18n::RIGHT_TO_LEFT;
1167 size_t anchor_position_index = sel.selection().start(); 1167 size_t anchor_position_index = sel.selection().start();
1168 size_t focus_position_index = sel.selection().end(); 1168 size_t focus_position_index = sel.selection().end();
1169 1169
1170 if (anchor_position_index == focus_position_index) { 1170 if (anchor_position_index == focus_position_index) {
1171 anchor->set_type(ui::SelectionBound::CENTER); 1171 anchor->set_type(ui::SelectionBound::CENTER);
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 RequestFocus(); 1891 RequestFocus();
1892 model_->MoveCursorTo(mouse); 1892 model_->MoveCursorTo(mouse);
1893 if (!selection_clipboard_text.empty()) { 1893 if (!selection_clipboard_text.empty()) {
1894 model_->InsertText(selection_clipboard_text); 1894 model_->InsertText(selection_clipboard_text);
1895 UpdateAfterChange(true, true); 1895 UpdateAfterChange(true, true);
1896 } 1896 }
1897 OnAfterUserAction(); 1897 OnAfterUserAction();
1898 } 1898 }
1899 1899
1900 } // namespace views 1900 } // namespace views
OLDNEW
« no previous file with comments | « ui/platform_window/android/platform_window_android.cc ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698