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

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

Issue 5473001: [cros] Use same textfield settings across existing/new user pods and screen lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proper fix Created 10 years 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
« no previous file with comments | « chrome/browser/chromeos/login/textfield_with_margin.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
8
7 namespace { 9 namespace {
8 10
9 // Holds ratio of the margin to the preferred text height. 11 // Holds ratio of the margin to the preferred text height.
10 const double kTextMarginRate = 0.33; 12 const double kTextMarginRate = 0.33;
11 13
12 // Size of each vertical margin (top, bottom). 14 // Size of each vertical margin (top, bottom).
13 const int kVerticalMargin = 3; 15 const int kVerticalMargin = 3;
14 16
15 } // namespace 17 } // namespace
16 18
17 namespace chromeos { 19 namespace chromeos {
18 20
19 TextfieldWithMargin::TextfieldWithMargin() { 21 TextfieldWithMargin::TextfieldWithMargin() {
22 CorrectTextfieldFontSize(this);
23 }
24
25 TextfieldWithMargin::TextfieldWithMargin(views::Textfield::StyleFlags style)
26 : Textfield(style) {
27 CorrectTextfieldFontSize(this);
20 } 28 }
21 29
22 void TextfieldWithMargin::Layout() { 30 void TextfieldWithMargin::Layout() {
23 int margin = GetPreferredSize().height() * kTextMarginRate; 31 int margin = GetPreferredSize().height() * kTextMarginRate;
24 SetHorizontalMargins(margin, margin); 32 SetHorizontalMargins(margin, margin);
25 SetVerticalMargins(kVerticalMargin, kVerticalMargin); 33 SetVerticalMargins(kVerticalMargin, kVerticalMargin);
26 views::Textfield::Layout(); 34 views::Textfield::Layout();
27 } 35 }
28 36
29 } // namespace chromeos 37 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/textfield_with_margin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698