| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |