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/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 void Textfield::InsertOrReplaceText(const base::string16& new_text) { | 325 void Textfield::InsertOrReplaceText(const base::string16& new_text) { |
326 if (new_text.empty()) | 326 if (new_text.empty()) |
327 return; | 327 return; |
328 model_->InsertText(new_text); | 328 model_->InsertText(new_text); |
329 OnCaretBoundsChanged(); | 329 OnCaretBoundsChanged(); |
330 SchedulePaint(); | 330 SchedulePaint(); |
331 } | 331 } |
332 | 332 |
333 base::i18n::TextDirection Textfield::GetTextDirection() const { | 333 base::i18n::TextDirection Textfield::GetTextDirection() const { |
334 return GetRenderText()->GetTextDirection(); | 334 return GetRenderText()->GetDisplayTextDirection(); |
335 } | 335 } |
336 | 336 |
337 base::string16 Textfield::GetSelectedText() const { | 337 base::string16 Textfield::GetSelectedText() const { |
338 return model_->GetSelectedText(); | 338 return model_->GetSelectedText(); |
339 } | 339 } |
340 | 340 |
341 void Textfield::SelectAll(bool reversed) { | 341 void Textfield::SelectAll(bool reversed) { |
342 model_->SelectAll(reversed); | 342 model_->SelectAll(reversed); |
343 UpdateSelectionClipboard(); | 343 UpdateSelectionClipboard(); |
344 UpdateAfterChange(false, true); | 344 UpdateAfterChange(false, true); |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 const size_t length = selection_clipboard_text.length(); | 1869 const size_t length = selection_clipboard_text.length(); |
1870 range = gfx::Range(range.start() + length, range.end() + length); | 1870 range = gfx::Range(range.start() + length, range.end() + length); |
1871 } | 1871 } |
1872 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1872 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
1873 UpdateAfterChange(true, true); | 1873 UpdateAfterChange(true, true); |
1874 OnAfterUserAction(); | 1874 OnAfterUserAction(); |
1875 } | 1875 } |
1876 } | 1876 } |
1877 | 1877 |
1878 } // namespace views | 1878 } // namespace views |
OLD | NEW |