Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/chromeos/login/new_user_view.cc

Issue 6034002: Replace Textfield::Keystroke with views::KeyEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: key_code, ET_KEY_PRESS for WM_CHAR Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/new_user_view.h ('k') | chrome/browser/chromeos/login/password_changed_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698