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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 void ScreenLockView::ClearAndSetFocusToPassword() { | 194 void ScreenLockView::ClearAndSetFocusToPassword() { |
195 password_field_->RequestFocus(); | 195 password_field_->RequestFocus(); |
196 password_field_->SetText(string16()); | 196 password_field_->SetText(string16()); |
197 } | 197 } |
198 | 198 |
199 void ScreenLockView::SetSignoutEnabled(bool enabled) { | 199 void ScreenLockView::SetSignoutEnabled(bool enabled) { |
200 user_view_->SetSignoutEnabled(enabled); | 200 user_view_->SetSignoutEnabled(enabled); |
201 } | 201 } |
202 | 202 |
203 gfx::Rect ScreenLockView::GetPasswordBoundsRelativeTo(const views::View* view) { | |
204 gfx::Point p; | |
205 views::View::ConvertPointToView(password_field_, view, &p); | |
206 return gfx::Rect(p, size()); | |
207 } | |
208 | |
209 void ScreenLockView::SetEnabled(bool enabled) { | 203 void ScreenLockView::SetEnabled(bool enabled) { |
210 views::View::SetEnabled(enabled); | 204 views::View::SetEnabled(enabled); |
211 | 205 |
212 if (!enabled) { | 206 if (!enabled) { |
213 // TODO(oshima): Re-enabling does not move the focus to the view | 207 // TODO(oshima): Re-enabling does not move the focus to the view |
214 // that had a focus (issue http://crbug.com/43131). | 208 // that had a focus (issue http://crbug.com/43131). |
215 // Clear focus on the textfield so that re-enabling can set focus | 209 // Clear focus on the textfield so that re-enabling can set focus |
216 // back to the text field. | 210 // back to the text field. |
217 // FocusManager may be null if the view does not have | 211 // FocusManager may be null if the view does not have |
218 // associated Widget yet. | 212 // associated Widget yet. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) | 248 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) |
255 return; | 249 return; |
256 | 250 |
257 User* user = content::Details<User>(details).ptr(); | 251 User* user = content::Details<User>(details).ptr(); |
258 if (screen_locker_->user().email() != user->email()) | 252 if (screen_locker_->user().email() != user->email()) |
259 return; | 253 return; |
260 user_view_->SetImage(user->image(), user->image()); | 254 user_view_->SetImage(user->image(), user->image()); |
261 } | 255 } |
262 | 256 |
263 } // namespace chromeos | 257 } // namespace chromeos |
OLD | NEW |