OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 598 |
599 void NativeTextfieldViews::UpdateVerticalMargins() { | 599 void NativeTextfieldViews::UpdateVerticalMargins() { |
600 int top, bottom; | 600 int top, bottom; |
601 if (!textfield_->GetVerticalMargins(&top, &bottom)) | 601 if (!textfield_->GetVerticalMargins(&top, &bottom)) |
602 return; | 602 return; |
603 gfx::Insets inset = GetInsets(); | 603 gfx::Insets inset = GetInsets(); |
604 text_border_->SetInsets(top, inset.left(), bottom, inset.right()); | 604 text_border_->SetInsets(top, inset.left(), bottom, inset.right()); |
605 OnBoundsChanged(GetBounds()); | 605 OnBoundsChanged(GetBounds()); |
606 } | 606 } |
607 | 607 |
608 void NativeTextfieldViews::UpdateVerticalAlignment() { | |
609 GetRenderText()->SetVerticalAlignment(textfield_->vertical_alignment()); | |
610 SchedulePaint(); | |
611 } | |
612 | |
613 bool NativeTextfieldViews::SetFocus() { | 608 bool NativeTextfieldViews::SetFocus() { |
614 return false; | 609 return false; |
615 } | 610 } |
616 | 611 |
617 View* NativeTextfieldViews::GetView() { | 612 View* NativeTextfieldViews::GetView() { |
618 return this; | 613 return this; |
619 } | 614 } |
620 | 615 |
621 gfx::NativeView NativeTextfieldViews::GetTestingHandle() const { | 616 gfx::NativeView NativeTextfieldViews::GetTestingHandle() const { |
622 NOTREACHED(); | 617 NOTREACHED(); |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 if (index != -1) { | 1516 if (index != -1) { |
1522 obscured_reveal_timer_.Start( | 1517 obscured_reveal_timer_.Start( |
1523 FROM_HERE, | 1518 FROM_HERE, |
1524 duration, | 1519 duration, |
1525 base::Bind(&NativeTextfieldViews::RevealObscuredChar, | 1520 base::Bind(&NativeTextfieldViews::RevealObscuredChar, |
1526 base::Unretained(this), -1, base::TimeDelta())); | 1521 base::Unretained(this), -1, base::TimeDelta())); |
1527 } | 1522 } |
1528 } | 1523 } |
1529 | 1524 |
1530 } // namespace views | 1525 } // namespace views |
OLD | NEW |