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/helper.h" | 5 #include "chrome/browser/chromeos/login/helper.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "chrome/browser/google/google_util.h" | 8 #include "chrome/browser/google/google_util.h" |
9 #include "gfx/canvas_skia.h" | 9 #include "gfx/canvas_skia.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
12 #include "third_party/skia/include/effects/SkGradientShader.h" | 12 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 13 #include "views/controls/button/menu_button.h" |
13 #include "views/controls/button/native_button.h" | 14 #include "views/controls/button/native_button.h" |
14 #include "views/controls/label.h" | 15 #include "views/controls/label.h" |
15 #include "views/controls/textfield/textfield.h" | 16 #include "views/controls/textfield/textfield.h" |
16 #include "views/controls/throbber.h" | 17 #include "views/controls/throbber.h" |
17 #include "views/painter.h" | 18 #include "views/painter.h" |
18 #include "views/screen.h" | 19 #include "views/screen.h" |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 namespace { | 23 namespace { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 96 } |
96 | 97 |
97 return bounds; | 98 return bounds; |
98 } | 99 } |
99 | 100 |
100 void CorrectLabelFontSize(views::Label* label) { | 101 void CorrectLabelFontSize(views::Label* label) { |
101 if (label) | 102 if (label) |
102 label->SetFont(label->font().DeriveFont(kFontSizeCorrectionDelta)); | 103 label->SetFont(label->font().DeriveFont(kFontSizeCorrectionDelta)); |
103 } | 104 } |
104 | 105 |
| 106 void CorrectMenuButtonFontSize(views::MenuButton* button) { |
| 107 if (button) |
| 108 button->SetFont(button->font().DeriveFont(kFontSizeCorrectionDelta)); |
| 109 } |
| 110 |
| 111 |
105 void CorrectNativeButtonFontSize(views::NativeButton* button) { | 112 void CorrectNativeButtonFontSize(views::NativeButton* button) { |
106 if (button) | 113 if (button) |
107 button->set_font(button->font().DeriveFont(kFontSizeCorrectionDelta)); | 114 button->set_font(button->font().DeriveFont(kFontSizeCorrectionDelta)); |
108 } | 115 } |
109 | 116 |
110 void CorrectTextfieldFontSize(views::Textfield* textfield) { | 117 void CorrectTextfieldFontSize(views::Textfield* textfield) { |
111 if (textfield) | 118 if (textfield) |
112 textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta)); | 119 textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta)); |
113 } | 120 } |
114 | 121 |
115 GURL GetAccountRecoveryHelpUrl() { | 122 GURL GetAccountRecoveryHelpUrl() { |
116 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); | 123 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); |
117 } | 124 } |
118 | 125 |
119 namespace login { | 126 namespace login { |
120 | 127 |
121 // Minimal width for the button. | 128 // Minimal width for the button. |
122 const int kButtonMinWidth = 90; | 129 const int kButtonMinWidth = 90; |
| 130 const int kButtonHeightDelta = 2; |
123 | 131 |
124 gfx::Size WideButton::GetPreferredSize() { | 132 gfx::Size WideButton::GetPreferredSize() { |
125 gfx::Size preferred_size = NativeButton::GetPreferredSize(); | 133 gfx::Size preferred_size = NativeButton::GetPreferredSize(); |
| 134 // Decrease vertical margins. |
| 135 preferred_size.set_height(preferred_size.height() - kButtonHeightDelta); |
| 136 // Set minimal width. |
126 if (preferred_size.width() < kButtonMinWidth) | 137 if (preferred_size.width() < kButtonMinWidth) |
127 preferred_size.set_width(kButtonMinWidth); | 138 preferred_size.set_width(kButtonMinWidth); |
128 return preferred_size; | 139 return preferred_size; |
129 } | 140 } |
130 | 141 |
131 } // namespace login | 142 } // namespace login |
132 | 143 |
133 } // namespace chromeos | 144 } // namespace chromeos |
134 | 145 |
OLD | NEW |