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

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

Issue 2730623003: Update views::Textfield cursor color on text color change (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 model_->SelectSelectionModel(sel); 506 model_->SelectSelectionModel(sel);
507 UpdateAfterChange(false, true); 507 UpdateAfterChange(false, true);
508 } 508 }
509 509
510 size_t Textfield::GetCursorPosition() const { 510 size_t Textfield::GetCursorPosition() const {
511 return model_->GetCursorPosition(); 511 return model_->GetCursorPosition();
512 } 512 }
513 513
514 void Textfield::SetColor(SkColor value) { 514 void Textfield::SetColor(SkColor value) {
515 GetRenderText()->SetColor(value); 515 GetRenderText()->SetColor(value);
516 cursor_view_.layer()->SetColor(value);
516 SchedulePaint(); 517 SchedulePaint();
517 } 518 }
518 519
519 void Textfield::ApplyColor(SkColor value, const gfx::Range& range) { 520 void Textfield::ApplyColor(SkColor value, const gfx::Range& range) {
520 GetRenderText()->ApplyColor(value, range); 521 GetRenderText()->ApplyColor(value, range);
521 SchedulePaint(); 522 SchedulePaint();
522 } 523 }
523 524
524 void Textfield::SetStyle(gfx::TextStyle style, bool value) { 525 void Textfield::SetStyle(gfx::TextStyle style, bool value) {
525 GetRenderText()->SetStyle(style, value); 526 GetRenderText()->SetStyle(style, value);
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 cursor_blink_timer_.Stop(); 2086 cursor_blink_timer_.Stop();
2086 } 2087 }
2087 2088
2088 void Textfield::OnCursorBlinkTimerFired() { 2089 void Textfield::OnCursorBlinkTimerFired() {
2089 DCHECK(ShouldBlinkCursor()); 2090 DCHECK(ShouldBlinkCursor());
2090 cursor_view_.SetVisible(!cursor_view_.visible()); 2091 cursor_view_.SetVisible(!cursor_view_.visible());
2091 UpdateCursorView(); 2092 UpdateCursorView();
2092 } 2093 }
2093 2094
2094 } // namespace views 2095 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698