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

Side by Side Diff: chrome/browser/chromeos/login/textfield_with_margin.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/textfield_with_margin.h" 5 #include "chrome/browser/chromeos/login/textfield_with_margin.h"
6 6
7 #include "chrome/browser/chromeos/login/helper.h" 7 #include "chrome/browser/chromeos/login/helper.h"
8 #include "ui/base/keycodes/keyboard_codes.h" 8 #include "ui/base/keycodes/keyboard_codes.h"
9 9
10 namespace { 10 namespace {
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 void TextfieldWithMargin::Layout() { 31 void TextfieldWithMargin::Layout() {
32 int margin = GetPreferredSize().height() * kTextMarginRate; 32 int margin = GetPreferredSize().height() * kTextMarginRate;
33 SetHorizontalMargins(margin, margin); 33 SetHorizontalMargins(margin, margin);
34 SetVerticalMargins(kVerticalMargin, kVerticalMargin); 34 SetVerticalMargins(kVerticalMargin, kVerticalMargin);
35 views::Textfield::Layout(); 35 views::Textfield::Layout();
36 } 36 }
37 37
38 bool TextfieldWithMargin::OnKeyPressed(const views::KeyEvent& e) { 38 bool TextfieldWithMargin::OnKeyPressed(const views::KeyEvent& e) {
39 if (e.GetKeyCode() == ui::VKEY_ESCAPE && !text().empty()) { 39 if (e.() == ui::VKEY_ESCAPE && !text().empty()) {
sky 2011/02/09 22:54:08 key_code
40 SetText(string16()); 40 SetText(string16());
41 return true; 41 return true;
42 } 42 }
43 return false; 43 return false;
44 } 44 }
45 45
46 } // namespace chromeos 46 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screen_lock_view.cc ('k') | chrome/browser/chromeos/options/wifi_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698