| 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/new_user_view.h" | 5 #include "chrome/browser/chromeos/login/new_user_view.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 title_hint_label_->SetMultiLine(true); | 143 title_hint_label_->SetMultiLine(true); |
| 144 AddChildView(title_hint_label_); | 144 AddChildView(title_hint_label_); |
| 145 | 145 |
| 146 splitter_up1_ = CreateSplitter(kSplitterUp1Color); | 146 splitter_up1_ = CreateSplitter(kSplitterUp1Color); |
| 147 splitter_up2_ = CreateSplitter(kSplitterUp2Color); | 147 splitter_up2_ = CreateSplitter(kSplitterUp2Color); |
| 148 splitter_down1_ = CreateSplitter(kSplitterDown1Color); | 148 splitter_down1_ = CreateSplitter(kSplitterDown1Color); |
| 149 splitter_down2_ = CreateSplitter(kSplitterDown2Color); | 149 splitter_down2_ = CreateSplitter(kSplitterDown2Color); |
| 150 | 150 |
| 151 username_field_ = new UsernameField(); | 151 username_field_ = new UsernameField(); |
| 152 username_field_->set_background(new CopyBackground(this)); | 152 username_field_->set_background(new CopyBackground(this)); |
| 153 username_field_->SetAccessibleName(std::wstring(L"Username")); |
| 153 AddChildView(username_field_); | 154 AddChildView(username_field_); |
| 154 | 155 |
| 155 password_field_ = new TextfieldWithMargin(views::Textfield::STYLE_PASSWORD); | 156 password_field_ = new TextfieldWithMargin(views::Textfield::STYLE_PASSWORD); |
| 156 password_field_->set_background(new CopyBackground(this)); | 157 password_field_->set_background(new CopyBackground(this)); |
| 157 AddChildView(password_field_); | 158 AddChildView(password_field_); |
| 158 | 159 |
| 159 language_switch_menu_.InitLanguageMenu(); | 160 language_switch_menu_.InitLanguageMenu(); |
| 160 | 161 |
| 161 RecreatePeculiarControls(); | 162 RecreatePeculiarControls(); |
| 162 | 163 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 190 } | 191 } |
| 191 | 192 |
| 192 bool NewUserView::AcceleratorPressed(const views::Accelerator& accelerator) { | 193 bool NewUserView::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 193 if (accelerator == accel_focus_user_) { | 194 if (accelerator == accel_focus_user_) { |
| 194 username_field_->RequestFocus(); | 195 username_field_->RequestFocus(); |
| 195 } else if (accelerator == accel_focus_pass_) { | 196 } else if (accelerator == accel_focus_pass_) { |
| 196 password_field_->RequestFocus(); | 197 password_field_->RequestFocus(); |
| 197 } else if (accelerator == accel_login_off_the_record_) { | 198 } else if (accelerator == accel_login_off_the_record_) { |
| 198 delegate_->OnLoginOffTheRecord(); | 199 delegate_->OnLoginOffTheRecord(); |
| 199 } else if (accelerator == accel_enable_accessibility_) { | 200 } else if (accelerator == accel_enable_accessibility_) { |
| 200 WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); | 201 WizardAccessibilityHelper::GetInstance()->ToggleAccessibility(this); |
| 201 } else { | 202 } else { |
| 202 return false; | 203 return false; |
| 203 } | 204 } |
| 204 return true; | 205 return true; |
| 205 } | 206 } |
| 206 | 207 |
| 207 void NewUserView::RecreatePeculiarControls() { | 208 void NewUserView::RecreatePeculiarControls() { |
| 208 // PreferredSize reported by MenuButton (and TextField) is not able | 209 // PreferredSize reported by MenuButton (and TextField) is not able |
| 209 // to shrink, only grow; so recreate on text change. | 210 // to shrink, only grow; so recreate on text change. |
| 210 delete languages_menubutton_; | 211 delete languages_menubutton_; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 545 |
| 545 void NewUserView::InitLink(views::Link** link) { | 546 void NewUserView::InitLink(views::Link** link) { |
| 546 *link = new views::Link(std::wstring()); | 547 *link = new views::Link(std::wstring()); |
| 547 (*link)->SetController(this); | 548 (*link)->SetController(this); |
| 548 (*link)->SetNormalColor(login::kLinkColor); | 549 (*link)->SetNormalColor(login::kLinkColor); |
| 549 (*link)->SetHighlightedColor(login::kLinkColor); | 550 (*link)->SetHighlightedColor(login::kLinkColor); |
| 550 AddChildView(*link); | 551 AddChildView(*link); |
| 551 } | 552 } |
| 552 | 553 |
| 553 } // namespace chromeos | 554 } // namespace chromeos |
| OLD | NEW |