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" |
11 #include "chrome/browser/chromeos/login/user_manager.h" | 11 #include "chrome/browser/chromeos/login/user_manager.h" |
12 #include "chrome/browser/chromeos/login/user_view.h" | 12 #include "chrome/browser/chromeos/login/user_view.h" |
13 #include "chrome/browser/chromeos/login/username_view.h" | 13 #include "chrome/browser/chromeos/login/username_view.h" |
14 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 14 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
15 #include "chrome/browser/chromeos/views/copy_background.h" | 15 #include "chrome/browser/chromeos/views/copy_background.h" |
16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
18 #include "content/common/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
22 #include "views/background.h" | 22 #include "views/background.h" |
23 #include "views/border.h" | 23 #include "views/border.h" |
24 #include "views/controls/image_view.h" | 24 #include "views/controls/image_view.h" |
25 #include "views/controls/label.h" | 25 #include "views/controls/label.h" |
26 #include "views/controls/textfield/native_textfield_wrapper.h" | 26 #include "views/controls/textfield/native_textfield_wrapper.h" |
27 #include "views/controls/textfield/textfield.h" | 27 #include "views/controls/textfield/textfield.h" |
28 #include "views/layout/grid_layout.h" | 28 #include "views/layout/grid_layout.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 username_->SetBounds( | 112 username_->SetBounds( |
113 kBorderSize, | 113 kBorderSize, |
114 login::kUserImageSize - username_height + kBorderSize, | 114 login::kUserImageSize - username_height + kBorderSize, |
115 login::kUserImageSize, | 115 login::kUserImageSize, |
116 username_height); | 116 username_height); |
117 } | 117 } |
118 | 118 |
119 void ScreenLockView::Init() { | 119 void ScreenLockView::Init() { |
120 registrar_.Add(this, | 120 registrar_.Add(this, |
121 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 121 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
122 NotificationService::AllSources()); | 122 content::NotificationService::AllSources()); |
123 | 123 |
124 user_view_ = new UserView(this, | 124 user_view_ = new UserView(this, |
125 false, // is_login | 125 false, // is_login |
126 true); // need_background | 126 true); // need_background |
127 main_ = new views::View(); | 127 main_ = new views::View(); |
128 main_->set_background( | 128 main_->set_background( |
129 views::Background::CreateSolidBackground( | 129 views::Background::CreateSolidBackground( |
130 kPodBackgroundColor)); | 130 kPodBackgroundColor)); |
131 | 131 |
132 // Password field. | 132 // Password field. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) | 254 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED || !user_view_) |
255 return; | 255 return; |
256 | 256 |
257 UserManager::User* user = content::Details<UserManager::User>(details).ptr(); | 257 UserManager::User* user = content::Details<UserManager::User>(details).ptr(); |
258 if (screen_locker_->user().email() != user->email()) | 258 if (screen_locker_->user().email() != user->email()) |
259 return; | 259 return; |
260 user_view_->SetImage(user->image(), user->image()); | 260 user_view_->SetImage(user->image(), user->image()); |
261 } | 261 } |
262 | 262 |
263 } // namespace chromeos | 263 } // namespace chromeos |
OLD | NEW |