OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (password_field_->GetFocusManager()) | 180 if (password_field_->GetFocusManager()) |
181 password_field_->GetFocusManager()->ClearFocus(); | 181 password_field_->GetFocusManager()->ClearFocus(); |
182 } | 182 } |
183 password_field_->SetEnabled(enabled); | 183 password_field_->SetEnabled(enabled); |
184 } | 184 } |
185 | 185 |
186 void ScreenLockView::OnSignout() { | 186 void ScreenLockView::OnSignout() { |
187 screen_locker_->Signout(); | 187 screen_locker_->Signout(); |
188 } | 188 } |
189 | 189 |
190 bool ScreenLockView::HandleKeystroke( | 190 bool ScreenLockView::HandleKeyEvent( |
191 views::Textfield* sender, | 191 views::Textfield* sender, |
192 const views::Textfield::Keystroke& keystroke) { | 192 const views::KeyEvent& key_event) { |
193 screen_locker_->ClearErrors(); | 193 screen_locker_->ClearErrors(); |
194 if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { | 194 if (key_event.GetKeyCode() == app::VKEY_RETURN) { |
195 screen_locker_->Authenticate(password_field_->text()); | 195 screen_locker_->Authenticate(password_field_->text()); |
196 return true; | 196 return true; |
197 } | 197 } |
198 return false; | 198 return false; |
199 } | 199 } |
200 | 200 |
201 void ScreenLockView::Observe( | 201 void ScreenLockView::Observe( |
202 NotificationType type, | 202 NotificationType type, |
203 const NotificationSource& source, | 203 const NotificationSource& source, |
204 const NotificationDetails& details) { | 204 const NotificationDetails& details) { |
205 if (type != NotificationType::LOGIN_USER_IMAGE_CHANGED || !user_view_) | 205 if (type != NotificationType::LOGIN_USER_IMAGE_CHANGED || !user_view_) |
206 return; | 206 return; |
207 | 207 |
208 UserManager::User* user = Details<UserManager::User>(details).ptr(); | 208 UserManager::User* user = Details<UserManager::User>(details).ptr(); |
209 if (screen_locker_->user().email() != user->email()) | 209 if (screen_locker_->user().email() != user->email()) |
210 return; | 210 return; |
211 user_view_->SetImage(user->image(), user->image()); | 211 user_view_->SetImage(user->image(), user->image()); |
212 } | 212 } |
213 | 213 |
214 void ScreenLockView::ViewHierarchyChanged(bool is_add, | 214 void ScreenLockView::ViewHierarchyChanged(bool is_add, |
215 views::View* parent, | 215 views::View* parent, |
216 views::View* child) { | 216 views::View* child) { |
217 if (is_add && this == child) | 217 if (is_add && this == child) |
218 WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); | 218 WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); |
219 } | 219 } |
220 | 220 |
221 } // namespace chromeos | 221 } // namespace chromeos |
OLD | NEW |