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 // This file contains helper functions used by Chromium OS login. | 5 // This file contains helper functions used by Chromium OS login. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
8 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 8 #define CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include "views/controls/button/native_button.h" | 11 #include "views/controls/button/native_button.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Rect; | 17 class Rect; |
18 class Size; | 18 class Size; |
19 } // namespace gfx | 19 } // namespace gfx |
20 | 20 |
21 namespace views { | 21 namespace views { |
22 class Label; | 22 class Label; |
| 23 class MenuButton; |
23 class Painter; | 24 class Painter; |
24 class Textfield; | 25 class Textfield; |
25 class Throbber; | 26 class Throbber; |
26 } // namespace views | 27 } // namespace views |
27 | 28 |
28 namespace chromeos { | 29 namespace chromeos { |
29 | 30 |
30 // Creates default smoothed throbber for time consuming operations on login. | 31 // Creates default smoothed throbber for time consuming operations on login. |
31 views::Throbber* CreateDefaultSmoothedThrobber(); | 32 views::Throbber* CreateDefaultSmoothedThrobber(); |
32 | 33 |
33 // Creates default throbber. | 34 // Creates default throbber. |
34 views::Throbber* CreateDefaultThrobber(); | 35 views::Throbber* CreateDefaultThrobber(); |
35 | 36 |
36 // Creates painter for login background. | 37 // Creates painter for login background. |
37 views::Painter* CreateBackgroundPainter(); | 38 views::Painter* CreateBackgroundPainter(); |
38 | 39 |
39 // Returns bounds of the screen to use for login wizard. | 40 // Returns bounds of the screen to use for login wizard. |
40 // The rect is centered within the default monitor and sized accordingly if | 41 // The rect is centered within the default monitor and sized accordingly if |
41 // |size| is not empty. Otherwise the whole monitor is occupied. | 42 // |size| is not empty. Otherwise the whole monitor is occupied. |
42 gfx::Rect CalculateScreenBounds(const gfx::Size& size); | 43 gfx::Rect CalculateScreenBounds(const gfx::Size& size); |
43 | 44 |
44 // Corrects font size for NativeButton control. | 45 // Corrects font size for Label control. |
45 void CorrectLabelFontSize(views::Label* label); | 46 void CorrectLabelFontSize(views::Label* label); |
46 | 47 |
| 48 // Corrects font size for MenuButton control. |
| 49 void CorrectMenuButtonFontSize(views::MenuButton* button); |
| 50 |
47 // Corrects font size for NativeButton control. | 51 // Corrects font size for NativeButton control. |
48 void CorrectNativeButtonFontSize(views::NativeButton* button); | 52 void CorrectNativeButtonFontSize(views::NativeButton* button); |
49 | 53 |
50 // Corrects font size for Textfield control. | 54 // Corrects font size for Textfield control. |
51 void CorrectTextfieldFontSize(views::Textfield* textfield); | 55 void CorrectTextfieldFontSize(views::Textfield* textfield); |
52 | 56 |
53 // Returns URL used for account recovery. | 57 // Returns URL used for account recovery. |
54 GURL GetAccountRecoveryHelpUrl(); | 58 GURL GetAccountRecoveryHelpUrl(); |
55 | 59 |
56 // Define the constants in |login| namespace to avoid potential | 60 // Define the constants in |login| namespace to avoid potential |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ~WideButton() {} | 103 ~WideButton() {} |
100 | 104 |
101 private: | 105 private: |
102 virtual gfx::Size GetPreferredSize(); | 106 virtual gfx::Size GetPreferredSize(); |
103 | 107 |
104 DISALLOW_COPY_AND_ASSIGN(WideButton); | 108 DISALLOW_COPY_AND_ASSIGN(WideButton); |
105 }; | 109 }; |
106 | 110 |
107 } // namespace login | 111 } // namespace login |
108 | 112 |
109 // Font size correction in points for login/oobe textfields/buttons/title. | 113 // Font size correction in points for login/oobe controls. |
| 114 #if defined(CROS_HAND_HINTED_FONTS) |
| 115 const int kFontSizeCorrectionDelta = 1; |
| 116 const int kUnselectedUsernameFontDelta = 0; |
| 117 const int kWelcomeTitleFontDelta = 5; |
| 118 #else |
110 const int kFontSizeCorrectionDelta = 2; | 119 const int kFontSizeCorrectionDelta = 2; |
| 120 const int kUnselectedUsernameFontDelta = 1; |
| 121 const int kWelcomeTitleFontDelta = 5; |
| 122 #endif |
111 | 123 |
112 // New pod sizes. | 124 // New pod sizes. |
113 const int kNewUserPodFullWidth = 372; | 125 const int kNewUserPodFullWidth = 372; |
114 const int kNewUserPodFullHeight = 372; | 126 const int kNewUserPodFullHeight = 372; |
115 const int kNewUserPodSmallWidth = 360; | 127 const int kNewUserPodSmallWidth = 360; |
116 const int kNewUserPodSmallHeight = 322; | 128 const int kNewUserPodSmallHeight = 322; |
117 | 129 |
118 } // namespace chromeos | 130 } // namespace chromeos |
119 | 131 |
120 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 132 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
OLD | NEW |