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/screen_lock_view.h" | 5 #include "chrome/browser/chromeos/login/screen_lock_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 8 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
9 #include "chrome/browser/chromeos/login/screen_locker.h" | 9 #include "chrome/browser/chromeos/login/screen_locker.h" |
10 #include "chrome/browser/chromeos/login/textfield_with_margin.h" | 10 #include "chrome/browser/chromeos/login/textfield_with_margin.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // User name. | 145 // User name. |
146 std::string display_name = user.GetDisplayName(); | 146 std::string display_name = user.GetDisplayName(); |
147 | 147 |
148 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 148 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
149 const gfx::Font& font = rb.GetFont(ResourceBundle::MediumBoldFont).DeriveFont( | 149 const gfx::Font& font = rb.GetFont(ResourceBundle::MediumBoldFont).DeriveFont( |
150 kSelectedUsernameFontDelta); | 150 kSelectedUsernameFontDelta); |
151 | 151 |
152 UsernameView* username = | 152 UsernameView* username = |
153 UsernameView::CreateShapedUsernameView(UTF8ToWide(display_name), false); | 153 UsernameView::CreateShapedUsernameView(UTF8ToWide(display_name), false); |
154 username_ = username; | 154 username_ = username; |
155 username->SetColor(login::kTextColor); | 155 username->SetEnabledColor(login::kTextColor); |
| 156 username->SetBackgroundColor(main_->background()->get_color()); |
156 username->SetFont(font); | 157 username->SetFont(font); |
157 | 158 |
158 // Add tooltip if screen name is not unique. | 159 // Add tooltip if screen name is not unique. |
159 if (user.NeedsNameTooltip()) { | 160 if (user.NeedsNameTooltip()) { |
160 string16 tooltip_text = UTF8ToUTF16(user.GetNameTooltip()); | 161 string16 tooltip_text = UTF8ToUTF16(user.GetNameTooltip()); |
161 user_view_->SetTooltipText(tooltip_text); | 162 user_view_->SetTooltipText(tooltip_text); |
162 username->SetTooltipText(tooltip_text); | 163 username->SetTooltipText(tooltip_text); |
163 } | 164 } |
164 | 165 |
165 // Layouts image, textfield and button components. | 166 // Layouts image, textfield and button components. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) | 254 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) |
254 return; | 255 return; |
255 | 256 |
256 UserManager::User* user = Details<UserManager::User>(details).ptr(); | 257 UserManager::User* user = Details<UserManager::User>(details).ptr(); |
257 if (screen_locker_->user().email() != user->email()) | 258 if (screen_locker_->user().email() != user->email()) |
258 return; | 259 return; |
259 user_view_->SetImage(user->image(), user->image()); | 260 user_view_->SetImage(user->image(), user->image()); |
260 } | 261 } |
261 | 262 |
262 } // namespace chromeos | 263 } // namespace chromeos |
OLD | NEW |