OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |