| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 } | 515 } |
| 516 | 516 |
| 517 gfx::Rect NewUserView::GetPasswordBounds() const { | 517 gfx::Rect NewUserView::GetPasswordBounds() const { |
| 518 return password_field_->GetScreenBounds(); | 518 return password_field_->GetScreenBounds(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 gfx::Rect NewUserView::GetUsernameBounds() const { | 521 gfx::Rect NewUserView::GetUsernameBounds() const { |
| 522 return username_field_->GetScreenBounds(); | 522 return username_field_->GetScreenBounds(); |
| 523 } | 523 } |
| 524 | 524 |
| 525 bool NewUserView::HandleKeystroke(views::Textfield* s, | 525 bool NewUserView::HandleKeyEvent(views::Textfield* sender, |
| 526 const views::Textfield::Keystroke& keystroke) { | 526 const views::KeyEvent& key_event) { |
| 527 if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_) | 527 if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_) |
| 528 return false; | 528 return false; |
| 529 | 529 |
| 530 if (keystroke.GetKeyboardCode() == app::VKEY_RETURN) { | 530 if (key_event.GetKeyCode() == app::VKEY_RETURN) { |
| 531 if (!username_field_->text().empty() && !password_field_->text().empty()) | 531 if (!username_field_->text().empty() && !password_field_->text().empty()) |
| 532 Login(); | 532 Login(); |
| 533 // Return true so that processing ends | 533 // Return true so that processing ends |
| 534 return true; | 534 return true; |
| 535 } | 535 } |
| 536 delegate_->ClearErrors(); | 536 delegate_->ClearErrors(); |
| 537 // Return false so that processing does not end | 537 // Return false so that processing does not end |
| 538 return false; | 538 return false; |
| 539 } | 539 } |
| 540 | 540 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 568 | 568 |
| 569 void NewUserView::InitLink(views::Link** link) { | 569 void NewUserView::InitLink(views::Link** link) { |
| 570 *link = new views::Link(std::wstring()); | 570 *link = new views::Link(std::wstring()); |
| 571 (*link)->SetController(this); | 571 (*link)->SetController(this); |
| 572 (*link)->SetNormalColor(login::kLinkColor); | 572 (*link)->SetNormalColor(login::kLinkColor); |
| 573 (*link)->SetHighlightedColor(login::kLinkColor); | 573 (*link)->SetHighlightedColor(login::kLinkColor); |
| 574 AddChildView(*link); | 574 AddChildView(*link); |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace chromeos | 577 } // namespace chromeos |
| OLD | NEW |