| 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 |
| 105 void CorrectNativeButtonFontSize(views::NativeButton* button) { | 111 void CorrectNativeButtonFontSize(views::NativeButton* button) { |
| 106 if (button) | 112 if (button) |
| 107 button->set_font(button->font().DeriveFont(kFontSizeCorrectionDelta)); | 113 button->set_font(button->font().DeriveFont(kFontSizeCorrectionDelta)); |
| 108 } | 114 } |
| 109 | 115 |
| 110 void CorrectTextfieldFontSize(views::Textfield* textfield) { | 116 void CorrectTextfieldFontSize(views::Textfield* textfield) { |
| 111 if (textfield) | 117 if (textfield) |
| 112 textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta)); | 118 textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta)); |
| 113 } | 119 } |
| 114 | 120 |
| 115 GURL GetAccountRecoveryHelpUrl() { | 121 GURL GetAccountRecoveryHelpUrl() { |
| 116 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); | 122 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); |
| 117 } | 123 } |
| 118 | 124 |
| 119 namespace login { | 125 namespace login { |
| 120 | 126 |
| 121 // Minimal width for the button. | 127 // Minimal width for the button. |
| 122 const int kButtonMinWidth = 90; | 128 const int kButtonMinWidth = 90; |
| 123 | 129 |
| 124 gfx::Size WideButton::GetPreferredSize() { | 130 gfx::Size WideButton::GetPreferredSize() { |
| 125 gfx::Size preferred_size = NativeButton::GetPreferredSize(); | 131 gfx::Size preferred_size = NativeButton::GetPreferredSize(); |
| 132 // Set minimal width. |
| 126 if (preferred_size.width() < kButtonMinWidth) | 133 if (preferred_size.width() < kButtonMinWidth) |
| 127 preferred_size.set_width(kButtonMinWidth); | 134 preferred_size.set_width(kButtonMinWidth); |
| 128 return preferred_size; | 135 return preferred_size; |
| 129 } | 136 } |
| 130 | 137 |
| 131 } // namespace login | 138 } // namespace login |
| 132 | 139 |
| 133 } // namespace chromeos | 140 } // namespace chromeos |
| 134 | 141 |
| OLD | NEW |