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

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

Issue 533403002: Fix touch selection for Athena home card (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed NeedsNotificationWhenVisibleBoundsChange() Created 6 years, 3 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
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 "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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698