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

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

Issue 6480001: Migrate Event API methods to Google Style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 was_trim = false; 78 was_trim = false;
79 } 79 }
80 } 80 }
81 81
82 if (was_trim) 82 if (was_trim)
83 SetText(user_input); 83 SetText(user_input);
84 } 84 }
85 85
86 // Overridden from views::View: 86 // Overridden from views::View:
87 virtual bool OnKeyPressed(const views::KeyEvent& e) { 87 virtual bool OnKeyPressed(const views::KeyEvent& e) {
88 if (e.GetKeyCode() == ui::VKEY_LEFT) { 88 if (e.key_code() == ui::VKEY_LEFT) {
89 return controller_->NavigateAway(); 89 return controller_->NavigateAway();
90 } 90 }
91 return false; 91 return false;
92 } 92 }
93 93
94 private: 94 private:
95 chromeos::NewUserView* controller_; 95 chromeos::NewUserView* controller_;
96 DISALLOW_COPY_AND_ASSIGN(UsernameField); 96 DISALLOW_COPY_AND_ASSIGN(UsernameField);
97 }; 97 };
98 98
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 gfx::Rect NewUserView::GetUsernameBounds() const { 506 gfx::Rect NewUserView::GetUsernameBounds() const {
507 return username_field_->GetScreenBounds(); 507 return username_field_->GetScreenBounds();
508 } 508 }
509 509
510 bool NewUserView::HandleKeyEvent(views::Textfield* sender, 510 bool NewUserView::HandleKeyEvent(views::Textfield* sender,
511 const views::KeyEvent& key_event) { 511 const views::KeyEvent& key_event) {
512 if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_) 512 if (!CrosLibrary::Get()->EnsureLoaded() || login_in_process_)
513 return false; 513 return false;
514 514
515 if (key_event.GetKeyCode() == ui::VKEY_RETURN) { 515 if (key_event.key_code() == ui::VKEY_RETURN) {
516 if (!username_field_->text().empty() && !password_field_->text().empty()) 516 if (!username_field_->text().empty() && !password_field_->text().empty())
517 Login(); 517 Login();
518 // Return true so that processing ends 518 // Return true so that processing ends
519 return true; 519 return true;
520 } 520 }
521 delegate_->ClearErrors(); 521 delegate_->ClearErrors();
522 // Return false so that processing does not end 522 // Return false so that processing does not end
523 return false; 523 return false;
524 } 524 }
525 525
(...skipping 30 matching lines...) Expand all
556 556
557 void NewUserView::InitLink(views::Link** link) { 557 void NewUserView::InitLink(views::Link** link) {
558 *link = new views::Link(std::wstring()); 558 *link = new views::Link(std::wstring());
559 (*link)->SetController(this); 559 (*link)->SetController(this);
560 (*link)->SetNormalColor(login::kLinkColor); 560 (*link)->SetNormalColor(login::kLinkColor);
561 (*link)->SetHighlightedColor(login::kLinkColor); 561 (*link)->SetHighlightedColor(login::kLinkColor);
562 AddChildView(*link); 562 AddChildView(*link);
563 } 563 }
564 564
565 } // namespace chromeos 565 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698