| 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/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
| 11 #include "chrome/browser/chromeos/login/screen_locker.h" | 11 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 12 #include "chrome/browser/chromeos/login/user_manager.h" | 12 #include "chrome/browser/chromeos/login/user_manager.h" |
| 13 #include "chrome/browser/chromeos/login/user_view.h" | 13 #include "chrome/browser/chromeos/login/user_view.h" |
| 14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
| 17 #include "views/background.h" | 17 #include "views/background.h" |
| 18 #include "views/border.h" | 18 #include "views/border.h" |
| 19 #include "views/controls/button/text_button.h" |
| 19 #include "views/controls/image_view.h" | 20 #include "views/controls/image_view.h" |
| 20 #include "views/controls/label.h" | 21 #include "views/controls/label.h" |
| 21 #include "views/grid_layout.h" | 22 #include "views/grid_layout.h" |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 using views::GridLayout; | 26 using views::GridLayout; |
| 26 using login::kBorderSize; | 27 using login::kBorderSize; |
| 27 | 28 |
| 28 ScreenLockView::ScreenLockView(ScreenLocker* screen_locker) | 29 ScreenLockView::ScreenLockView(ScreenLocker* screen_locker) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 43 main->set_background( | 44 main->set_background( |
| 44 views::Background::CreateSolidBackground(login::kBackgroundColor)); | 45 views::Background::CreateSolidBackground(login::kBackgroundColor)); |
| 45 | 46 |
| 46 // Password field. | 47 // Password field. |
| 47 password_field_ = new views::Textfield(views::Textfield::STYLE_PASSWORD); | 48 password_field_ = new views::Textfield(views::Textfield::STYLE_PASSWORD); |
| 48 password_field_->set_text_to_display_when_empty( | 49 password_field_->set_text_to_display_when_empty( |
| 49 l10n_util::GetStringUTF16(IDS_LOGIN_EMPTY_PASSWORD_TEXT)); | 50 l10n_util::GetStringUTF16(IDS_LOGIN_EMPTY_PASSWORD_TEXT)); |
| 50 password_field_->SetController(this); | 51 password_field_->SetController(this); |
| 51 | 52 |
| 52 // Unlock button. | 53 // Unlock button. |
| 53 // TODO(sky|oshima): change ids | |
| 54 unlock_button_ = new views::TextButton( | 54 unlock_button_ = new views::TextButton( |
| 55 this, l10n_util::GetString(IDS_LOGIN_BUTTON)); | 55 this, l10n_util::GetString(IDS_UNLOCK_BUTTON)); |
| 56 unlock_button_->set_tag(login::UNLOCK); | 56 unlock_button_->set_tag(login::UNLOCK); |
| 57 | 57 |
| 58 // User icon. | 58 // User icon. |
| 59 UserManager::User user = screen_locker_->user(); | 59 UserManager::User user = screen_locker_->user(); |
| 60 user_view_->SetImage(user.image()); | 60 user_view_->SetImage(user.image()); |
| 61 | 61 |
| 62 // User name. | 62 // User name. |
| 63 std::wstring text = UTF8ToWide(user.GetDisplayName()); | 63 std::wstring text = UTF8ToWide(user.GetDisplayName()); |
| 64 views::Label* label = new views::Label(text); | 64 views::Label* label = new views::Label(text); |
| 65 label->SetColor(login::kTextColor); | 65 label->SetColor(login::kTextColor); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return; | 178 return; |
| 179 | 179 |
| 180 UserManager::User* user = Details<UserManager::User>(details).ptr(); | 180 UserManager::User* user = Details<UserManager::User>(details).ptr(); |
| 181 if (screen_locker_->user().email() != user->email()) | 181 if (screen_locker_->user().email() != user->email()) |
| 182 return; | 182 return; |
| 183 | 183 |
| 184 user_view_->SetImage(user->image()); | 184 user_view_->SetImage(user->image()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace chromeos | 187 } // namespace chromeos |
| OLD | NEW |