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

Unified Diff: views/touchui/touch_selection_controller_impl_unittest.cc

Issue 7466048: Fix RenderText cached bounds and offset logic; update clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments. Created 9 years, 4 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 | « views/controls/textfield/native_textfield_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/touchui/touch_selection_controller_impl_unittest.cc
diff --git a/views/touchui/touch_selection_controller_impl_unittest.cc b/views/touchui/touch_selection_controller_impl_unittest.cc
index a722af102a6f20742be301feda28c20047764b68..75353fefa07a44fea383ae2837d3828fe911d3a8 100644
--- a/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -38,7 +38,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
textfield_ = new Textfield();
widget_ = new Widget;
Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
- params.bounds = gfx::Rect(0, 0, 100, 100);
+ params.bounds = gfx::Rect(0, 0, 200, 200);
widget_->Init(params);
View* container = new View();
widget_->SetContentsView(container);
@@ -58,12 +58,7 @@ class TouchSelectionControllerImplTest : public ViewsTestBase {
gfx::RenderText* render_text = textfield_view_->GetRenderText();
gfx::Rect cursor_bounds = render_text->GetCursorBounds(
gfx::SelectionModel(cursor_pos), false);
- gfx::Rect display_rect = render_text->display_rect();
- int total_offset_x = display_rect.x() + render_text->display_offset().x();
- int total_offset_y = display_rect.y() + render_text->display_offset().y() +
- (display_rect.height() - cursor_bounds.height()) / 2;
- return gfx::Point(cursor_bounds.x() + total_offset_x,
- cursor_bounds.bottom() + total_offset_y);
+ return gfx::Point(cursor_bounds.x(), cursor_bounds.bottom());
}
TouchSelectionControllerImpl* GetSelectionController() {
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698