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 "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 base::Bind(&Textfield::AccessibilitySetValue, | 916 base::Bind(&Textfield::AccessibilitySetValue, |
917 weak_ptr_factory_.GetWeakPtr()); | 917 weak_ptr_factory_.GetWeakPtr()); |
918 } | 918 } |
919 } | 919 } |
920 | 920 |
921 void Textfield::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 921 void Textfield::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
922 GetRenderText()->SetDisplayRect(GetContentsBounds()); | 922 GetRenderText()->SetDisplayRect(GetContentsBounds()); |
923 OnCaretBoundsChanged(); | 923 OnCaretBoundsChanged(); |
924 } | 924 } |
925 | 925 |
| 926 bool Textfield::GetNeedsNotificationWhenVisibleBoundsChange() const { |
| 927 return true; |
| 928 } |
| 929 |
| 930 void Textfield::OnVisibleBoundsChanged() { |
| 931 if (touch_selection_controller_) |
| 932 touch_selection_controller_->SelectionChanged(); |
| 933 } |
| 934 |
926 void Textfield::OnEnabledChanged() { | 935 void Textfield::OnEnabledChanged() { |
927 View::OnEnabledChanged(); | 936 View::OnEnabledChanged(); |
928 if (GetInputMethod()) | 937 if (GetInputMethod()) |
929 GetInputMethod()->OnTextInputTypeChanged(this); | 938 GetInputMethod()->OnTextInputTypeChanged(this); |
930 SchedulePaint(); | 939 SchedulePaint(); |
931 } | 940 } |
932 | 941 |
933 void Textfield::OnPaint(gfx::Canvas* canvas) { | 942 void Textfield::OnPaint(gfx::Canvas* canvas) { |
934 OnPaintBackground(canvas); | 943 OnPaintBackground(canvas); |
935 PaintTextAndCursor(canvas); | 944 PaintTextAndCursor(canvas); |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 const size_t length = selection_clipboard_text.length(); | 1801 const size_t length = selection_clipboard_text.length(); |
1793 range = gfx::Range(range.start() + length, range.end() + length); | 1802 range = gfx::Range(range.start() + length, range.end() + length); |
1794 } | 1803 } |
1795 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1804 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
1796 UpdateAfterChange(true, true); | 1805 UpdateAfterChange(true, true); |
1797 OnAfterUserAction(); | 1806 OnAfterUserAction(); |
1798 } | 1807 } |
1799 } | 1808 } |
1800 | 1809 |
1801 } // namespace views | 1810 } // namespace views |
OLD | NEW |