| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 void ScreenLockView::Init() { | 118 void ScreenLockView::Init() { |
| 119 registrar_.Add(this, | 119 registrar_.Add(this, |
| 120 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 120 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 121 NotificationService::AllSources()); | 121 NotificationService::AllSources()); |
| 122 | 122 |
| 123 user_view_ = new UserView(this, | 123 user_view_ = new UserView(this, |
| 124 false, // is_login | 124 false, // is_login |
| 125 true); // need_background | 125 true); // need_background |
| 126 main_ = new views::View(); | 126 main_ = new views::View(); |
| 127 // Use rounded rect background. | |
| 128 views::Painter* painter = | |
| 129 CreateWizardPainter(&BorderDefinition::kUserBorder); | |
| 130 | |
| 131 main_->set_background( | 127 main_->set_background( |
| 132 views::Background::CreateBackgroundPainter(true, painter)); | 128 views::Background::CreateVerticalGradientBackground( |
| 133 main_->set_border(CreateWizardBorder(&BorderDefinition::kUserBorder)); | 129 BorderDefinition::kUserBorder.top_color, |
| 130 BorderDefinition::kUserBorder.bottom_color)); |
| 134 | 131 |
| 135 // Password field. | 132 // Password field. |
| 136 password_field_ = new PasswordField(); | 133 password_field_ = new PasswordField(); |
| 137 | 134 |
| 138 password_field_->SetController(this); | 135 password_field_->SetController(this); |
| 139 password_field_->set_background(new CopyBackground(main_)); | 136 password_field_->set_background(new CopyBackground(main_)); |
| 140 | 137 |
| 141 // Setup ThrobberView's host view. | 138 // Setup ThrobberView's host view. |
| 142 set_host_view(password_field_); | 139 set_host_view(password_field_); |
| 143 | 140 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) | 253 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) |
| 257 return; | 254 return; |
| 258 | 255 |
| 259 UserManager::User* user = Details<UserManager::User>(details).ptr(); | 256 UserManager::User* user = Details<UserManager::User>(details).ptr(); |
| 260 if (screen_locker_->user().email() != user->email()) | 257 if (screen_locker_->user().email() != user->email()) |
| 261 return; | 258 return; |
| 262 user_view_->SetImage(user->image(), user->image()); | 259 user_view_->SetImage(user->image(), user->image()); |
| 263 } | 260 } |
| 264 | 261 |
| 265 } // namespace chromeos | 262 } // namespace chromeos |
| OLD | NEW |