| 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/examples/textfield_example.h" | 5 #include "ui/views/examples/textfield_example.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 if (name_->text().length() >= 5) { | 143 if (name_->text().length() >= 5) { |
| 144 size_t fifth = name_->text().length() / 5; | 144 size_t fifth = name_->text().length() / 5; |
| 145 const gfx::Range big_range(1 * fifth, 4 * fifth); | 145 const gfx::Range big_range(1 * fifth, 4 * fifth); |
| 146 name_->ApplyStyle(gfx::UNDERLINE, true, big_range); | 146 name_->ApplyStyle(gfx::UNDERLINE, true, big_range); |
| 147 name_->ApplyColor(SK_ColorBLUE, big_range); | 147 name_->ApplyColor(SK_ColorBLUE, big_range); |
| 148 | 148 |
| 149 const gfx::Range small_range(2 * fifth, 3 * fifth); | 149 const gfx::Range small_range(2 * fifth, 3 * fifth); |
| 150 name_->ApplyStyle(gfx::ITALIC, true, small_range); | 150 name_->ApplyStyle(gfx::ITALIC, true, small_range); |
| 151 name_->ApplyStyle(gfx::UNDERLINE, false, small_range); | 151 name_->ApplyStyle(gfx::UNDERLINE, false, small_range); |
| 152 name_->ApplyStyle(gfx::DIAGONAL_STRIKE, true, small_range); | |
| 153 name_->ApplyColor(SK_ColorRED, small_range); | 152 name_->ApplyColor(SK_ColorRED, small_range); |
| 154 } | 153 } |
| 155 } | 154 } |
| 156 } | 155 } |
| 157 } | 156 } |
| 158 | 157 |
| 159 } // namespace examples | 158 } // namespace examples |
| 160 } // namespace views | 159 } // namespace views |
| OLD | NEW |