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

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

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/examples/text_example.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/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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 void Textfield::SelectSelectionModel(const gfx::SelectionModel& sel) { 361 void Textfield::SelectSelectionModel(const gfx::SelectionModel& sel) {
362 DCHECK(native_wrapper_); 362 DCHECK(native_wrapper_);
363 native_wrapper_->SelectSelectionModel(sel); 363 native_wrapper_->SelectSelectionModel(sel);
364 } 364 }
365 365
366 size_t Textfield::GetCursorPosition() const { 366 size_t Textfield::GetCursorPosition() const {
367 DCHECK(native_wrapper_); 367 DCHECK(native_wrapper_);
368 return native_wrapper_->GetCursorPosition(); 368 return native_wrapper_->GetCursorPosition();
369 } 369 }
370 370
371 void Textfield::ApplyStyleRange(const gfx::StyleRange& style) { 371 void Textfield::SetColor(SkColor value) {
372 DCHECK(native_wrapper_); 372 DCHECK(native_wrapper_);
373 return native_wrapper_->ApplyStyleRange(style); 373 return native_wrapper_->SetColor(value);
374 } 374 }
375 375
376 void Textfield::ApplyDefaultStyle() { 376 void Textfield::ApplyColor(SkColor value, const ui::Range& range) {
377 DCHECK(native_wrapper_); 377 DCHECK(native_wrapper_);
378 native_wrapper_->ApplyDefaultStyle(); 378 return native_wrapper_->ApplyColor(value, range);
379 }
380
381 void Textfield::SetStyle(gfx::TextStyle style, bool value) {
382 DCHECK(native_wrapper_);
383 return native_wrapper_->SetStyle(style, value);
384 }
385
386 void Textfield::ApplyStyle(gfx::TextStyle style,
387 bool value,
388 const ui::Range& range) {
389 DCHECK(native_wrapper_);
390 return native_wrapper_->ApplyStyle(style, value, range);
379 } 391 }
380 392
381 void Textfield::ClearEditHistory() { 393 void Textfield::ClearEditHistory() {
382 DCHECK(native_wrapper_); 394 DCHECK(native_wrapper_);
383 native_wrapper_->ClearEditHistory(); 395 native_wrapper_->ClearEditHistory();
384 } 396 }
385 397
386 void Textfield::SetAccessibleName(const string16& name) { 398 void Textfield::SetAccessibleName(const string16& name) {
387 accessible_name_ = name; 399 accessible_name_ = name;
388 } 400 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 559 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
548 Textfield* field) { 560 Textfield* field) {
549 #if defined(OS_WIN) && !defined(USE_AURA) 561 #if defined(OS_WIN) && !defined(USE_AURA)
550 if (!Textfield::IsViewsTextfieldEnabled()) 562 if (!Textfield::IsViewsTextfieldEnabled())
551 return new NativeTextfieldWin(field); 563 return new NativeTextfieldWin(field);
552 #endif 564 #endif
553 return new NativeTextfieldViews(field); 565 return new NativeTextfieldViews(field);
554 } 566 }
555 567
556 } // namespace views 568 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/examples/text_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698