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

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

Issue 138023004: Use local coordinates in TouchEditable interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added TODO for switching to screen coordinates Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/touch/touch_editing_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 void Textfield::GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) { 961 void Textfield::GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) {
962 gfx::RenderText* render_text = GetRenderText(); 962 gfx::RenderText* render_text = GetRenderText();
963 const gfx::SelectionModel& sel = render_text->selection_model(); 963 const gfx::SelectionModel& sel = render_text->selection_model();
964 gfx::SelectionModel start_sel = 964 gfx::SelectionModel start_sel =
965 render_text->GetSelectionModelForSelectionStart(); 965 render_text->GetSelectionModelForSelectionStart();
966 *p1 = render_text->GetCursorBounds(start_sel, true); 966 *p1 = render_text->GetCursorBounds(start_sel, true);
967 *p2 = render_text->GetCursorBounds(sel, true); 967 *p2 = render_text->GetCursorBounds(sel, true);
968 } 968 }
969 969
970 gfx::Rect Textfield::GetBounds() { 970 gfx::Rect Textfield::GetBounds() {
971 return bounds(); 971 return GetLocalBounds();
972 } 972 }
973 973
974 gfx::NativeView Textfield::GetNativeView() const { 974 gfx::NativeView Textfield::GetNativeView() const {
975 return GetWidget()->GetNativeView(); 975 return GetWidget()->GetNativeView();
976 } 976 }
977 977
978 void Textfield::ConvertPointToScreen(gfx::Point* point) { 978 void Textfield::ConvertPointToScreen(gfx::Point* point) {
979 View::ConvertPointToScreen(this, point); 979 View::ConvertPointToScreen(this, point);
980 } 980 }
981 981
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 void Textfield::CreateTouchSelectionControllerAndNotifyIt() { 1530 void Textfield::CreateTouchSelectionControllerAndNotifyIt() {
1531 if (!touch_selection_controller_) { 1531 if (!touch_selection_controller_) {
1532 touch_selection_controller_.reset( 1532 touch_selection_controller_.reset(
1533 ui::TouchSelectionController::create(this)); 1533 ui::TouchSelectionController::create(this));
1534 } 1534 }
1535 if (touch_selection_controller_) 1535 if (touch_selection_controller_)
1536 touch_selection_controller_->SelectionChanged(); 1536 touch_selection_controller_->SelectionChanged();
1537 } 1537 }
1538 1538
1539 } // namespace views 1539 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/touch/touch_editing_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698