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

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

Issue 916203002: Reduce the number of text reshaping in RenderText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « ui/gfx/text_elider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/text_elider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698