| Index: views/controls/textfield/native_textfield_views.cc
|
| diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc
|
| index a3ad114eb91a49c752df741c441d3499428b0ca5..b50e8d64ed6733eff68fd8981f54411f1f1499cb 100644
|
| --- a/views/controls/textfield/native_textfield_views.cc
|
| +++ b/views/controls/textfield/native_textfield_views.cc
|
| @@ -57,7 +57,6 @@ NativeTextfieldViews::NativeTextfieldViews(Textfield* parent)
|
| insert_(true),
|
| is_cursor_visible_(false),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(cursor_timer_(this)) {
|
| - SetFocusable(true);
|
| set_border(text_border_);
|
|
|
| // Multiline is not supported.
|
| @@ -73,7 +72,7 @@ NativeTextfieldViews::~NativeTextfieldViews() {
|
| // NativeTextfieldViews, View overrides:
|
|
|
| bool NativeTextfieldViews::OnMousePressed(const views::MouseEvent& e) {
|
| - RequestFocus();
|
| + textfield_->RequestFocus();
|
| size_t pos = FindCursorPosition(e.location());
|
| if (model_->MoveCursorTo(pos, false)) {
|
| UpdateCursorBoundsAndTextOffset();
|
| @@ -110,7 +109,7 @@ bool NativeTextfieldViews::OnKeyReleased(const views::KeyEvent& e) {
|
| }
|
|
|
| void NativeTextfieldViews::Paint(gfx::Canvas* canvas) {
|
| - text_border_->set_has_focus(HasFocus());
|
| + text_border_->set_has_focus(textfield_->HasFocus());
|
| PaintBackground(canvas);
|
| PaintTextAndCursor(canvas);
|
| if (textfield_->draw_border())
|
| @@ -140,7 +139,7 @@ void NativeTextfieldViews::WillLoseFocus() {
|
| }
|
|
|
| void NativeTextfieldViews::DidChangeBounds(const gfx::Rect& previous,
|
| - const gfx::Rect& current) {
|
| + const gfx::Rect& current) {
|
| UpdateCursorBoundsAndTextOffset();
|
| }
|
|
|
| @@ -225,15 +224,10 @@ void NativeTextfieldViews::UpdateIsPassword() {
|
| }
|
|
|
| void NativeTextfieldViews::UpdateEnabled() {
|
| + SetEnabled(textfield_->IsEnabled());
|
| SchedulePaint();
|
| }
|
|
|
| -bool NativeTextfieldViews::IsPassword() {
|
| - // looks unnecessary. should we remove?
|
| - NOTREACHED();
|
| - return false;
|
| -}
|
| -
|
| gfx::Insets NativeTextfieldViews::CalculateInsets() {
|
| return GetInsets();
|
| }
|
| @@ -258,8 +252,8 @@ void NativeTextfieldViews::UpdateVerticalMargins() {
|
| UpdateCursorBoundsAndTextOffset();
|
| }
|
|
|
| -void NativeTextfieldViews::SetFocus() {
|
| - RequestFocus();
|
| +bool NativeTextfieldViews::SetFocus() {
|
| + return false;
|
| }
|
|
|
| View* NativeTextfieldViews::GetView() {
|
| @@ -370,7 +364,8 @@ void NativeTextfieldViews::PaintTextAndCursor(gfx::Canvas* canvas) {
|
| int y = insets.top();
|
| int text_height = height() - insets.height();
|
| SkColor selection_color =
|
| - HasFocus() ? kFocusedSelectionColor : kUnfocusedSelectionColor;
|
| + textfield_->HasFocus() ?
|
| + kFocusedSelectionColor : kUnfocusedSelectionColor;
|
| SkColor text_color =
|
| textfield_->read_only() ? kReadonlyTextColor : GetTextColor();
|
|
|
|
|