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

Side by Side Diff: ui/gfx/render_text_win.cc

Issue 779793006: MacViews: Use RenderTextHarfBuzz only for Textfields (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename to CreateInstanceOfSameType Created 6 years 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/render_text_win.h ('k') | ui/views/controls/textfield/textfield_model.cc » ('j') | 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/gfx/render_text_win.h" 5 #include "ui/gfx/render_text_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/break_iterator.h" 9 #include "base/i18n/break_iterator.h"
10 #include "base/i18n/char_iterator.h" 10 #include "base/i18n/char_iterator.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 RenderTextWin::RenderTextWin() : RenderText(), needs_layout_(false) { 470 RenderTextWin::RenderTextWin() : RenderText(), needs_layout_(false) {
471 set_truncate_length(kMaxUniscribeTextLength); 471 set_truncate_length(kMaxUniscribeTextLength);
472 memset(&script_control_, 0, sizeof(script_control_)); 472 memset(&script_control_, 0, sizeof(script_control_));
473 memset(&script_state_, 0, sizeof(script_state_)); 473 memset(&script_state_, 0, sizeof(script_state_));
474 MoveCursorTo(EdgeSelectionModel(CURSOR_LEFT)); 474 MoveCursorTo(EdgeSelectionModel(CURSOR_LEFT));
475 } 475 }
476 476
477 RenderTextWin::~RenderTextWin() {} 477 RenderTextWin::~RenderTextWin() {}
478 478
479 scoped_ptr<RenderText> RenderTextWin::CreateInstanceOfSameType() const {
480 return scoped_ptr<RenderTextWin>(new RenderTextWin);
481 }
482
479 Size RenderTextWin::GetStringSize() { 483 Size RenderTextWin::GetStringSize() {
480 EnsureLayout(); 484 EnsureLayout();
481 return multiline_string_size_; 485 return multiline_string_size_;
482 } 486 }
483 487
484 SelectionModel RenderTextWin::FindCursorPosition(const Point& point) { 488 SelectionModel RenderTextWin::FindCursorPosition(const Point& point) {
485 if (text().empty()) 489 if (text().empty())
486 return SelectionModel(); 490 return SelectionModel();
487 491
488 EnsureLayout(); 492 EnsureLayout();
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 size_t position = LayoutIndexToTextIndex(run->range.end()); 1252 size_t position = LayoutIndexToTextIndex(run->range.end());
1249 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); 1253 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD);
1250 return SelectionModel(position, CURSOR_FORWARD); 1254 return SelectionModel(position, CURSOR_FORWARD);
1251 } 1255 }
1252 1256
1253 RenderText* RenderText::CreateNativeInstance() { 1257 RenderText* RenderText::CreateNativeInstance() {
1254 return new RenderTextWin; 1258 return new RenderTextWin;
1255 } 1259 }
1256 1260
1257 } // namespace gfx 1261 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_win.h ('k') | ui/views/controls/textfield/textfield_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698