OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/username_view.h" | 5 #include "chrome/browser/chromeos/login/username_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 solid_shader->unref(); | 105 solid_shader->unref(); |
106 | 106 |
107 SkPaint paint; | 107 SkPaint paint; |
108 paint.setShader(composite_shader)->unref(); | 108 paint.setShader(composite_shader)->unref(); |
109 canvas.sk_canvas()->drawPaint(paint); | 109 canvas.sk_canvas()->drawPaint(paint); |
110 } | 110 } |
111 | 111 |
112 // Draw the text. | 112 // Draw the text. |
113 // Note, direct call of the DrawStringInt method produces the green dots | 113 // Note, direct call of the DrawStringInt method produces the green dots |
114 // along the text perimeter (when the label is place on the white background). | 114 // along the text perimeter (when the label is place on the white background). |
115 SkColor text_color = IsEnabled() ? enabled_color() : disabled_color(); | 115 SkColor text_color = enabled() ? enabled_color() : disabled_color(); |
116 SkColor kInvisibleHaloColor = 0x00000000; | 116 SkColor kInvisibleHaloColor = 0x00000000; |
117 canvas.DrawStringWithHalo(GetText(), font(), text_color, | 117 canvas.DrawStringWithHalo(GetText(), font(), text_color, |
118 kInvisibleHaloColor, bounds.x() + margin_width_, | 118 kInvisibleHaloColor, bounds.x() + margin_width_, |
119 bounds.y(), bounds.width() - 2 * margin_width_, | 119 bounds.y(), bounds.width() - 2 * margin_width_, |
120 bounds.height(), flags); | 120 bounds.height(), flags); |
121 | 121 |
122 text_image_.reset(new SkBitmap(canvas.ExtractBitmap())); | 122 text_image_.reset(new SkBitmap(canvas.ExtractBitmap())); |
123 | 123 |
124 if (use_fading_for_text) { | 124 if (use_fading_for_text) { |
125 // Fade out only the text in the end. Use regular background. | 125 // Fade out only the text in the end. Use regular background. |
(...skipping 18 matching lines...) Expand all Loading... |
144 void UsernameView::OnLocaleChanged() { | 144 void UsernameView::OnLocaleChanged() { |
145 if (is_guest_) { | 145 if (is_guest_) { |
146 SetText(l10n_util::GetStringUTF16(IDS_GUEST)); | 146 SetText(l10n_util::GetStringUTF16(IDS_GUEST)); |
147 } | 147 } |
148 // Repaint because the font may have changed. | 148 // Repaint because the font may have changed. |
149 text_image_.reset(); | 149 text_image_.reset(); |
150 SchedulePaint(); | 150 SchedulePaint(); |
151 } | 151 } |
152 | 152 |
153 } // namespace chromeos | 153 } // namespace chromeos |
OLD | NEW |