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 "third_party/skia/include/core/SkColor.h" |
11 #include "views/controls/button/native_button.h" | 12 #include "views/controls/button/native_button.h" |
12 #include "third_party/skia/include/core/SkColor.h" | 13 #include "views/widget/widget_gtk.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Rect; | 18 class Rect; |
18 class Size; | 19 class Size; |
19 } // namespace gfx | 20 } // namespace gfx |
20 | 21 |
21 namespace views { | 22 namespace views { |
22 class Label; | 23 class Label; |
23 class MenuButton; | 24 class MenuButton; |
24 class Painter; | 25 class Painter; |
25 class Textfield; | 26 class Textfield; |
26 class Throbber; | 27 class Throbber; |
| 28 class Widget; |
27 } // namespace views | 29 } // namespace views |
28 | 30 |
29 namespace chromeos { | 31 namespace chromeos { |
30 | 32 |
| 33 // This class manages showing the throbber in the separate popup widget. |
| 34 class ThrobberManager { |
| 35 public: |
| 36 ThrobberManager(); |
| 37 virtual ~ThrobberManager(); |
| 38 |
| 39 // Creates throbber above the given host in the right side with the given |
| 40 // margin. Also places throbber in the middle of the vertical host size. It |
| 41 // takes the ownership of the |throbber|. At most one throbber is shown at |
| 42 // each moment, so calling this method will close the previously created |
| 43 // throbber. |
| 44 void CreateAndStart(views::Widget* host, |
| 45 views::Throbber* throbber, |
| 46 int right_margin); |
| 47 |
| 48 // Creates throbber above the given host using the relative bounds given. It |
| 49 // takes the ownership of the |throbber|. At most one throbber is shown at |
| 50 // each moment, so calling this method will close the previously created |
| 51 // throbber. |
| 52 void CreateAndStart(views::Widget* host, |
| 53 views::Throbber* throbber, |
| 54 const gfx::Rect& relative_bounds); |
| 55 |
| 56 // Stops and closes the throbber (if any). |
| 57 void StopAndClose(); |
| 58 |
| 59 private: |
| 60 // Holds the widget that shows the throbber. |
| 61 views::Widget* throbber_widget_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ThrobberManager); |
| 64 }; |
| 65 |
31 // Creates default smoothed throbber for time consuming operations on login. | 66 // Creates default smoothed throbber for time consuming operations on login. |
32 views::Throbber* CreateDefaultSmoothedThrobber(); | 67 views::Throbber* CreateDefaultSmoothedThrobber(); |
33 | 68 |
34 // Creates default throbber. | 69 // Creates default throbber. |
35 views::Throbber* CreateDefaultThrobber(); | 70 views::Throbber* CreateDefaultThrobber(); |
36 | 71 |
37 // Creates painter for login background. | 72 // Creates painter for login background. |
38 views::Painter* CreateBackgroundPainter(); | 73 views::Painter* CreateBackgroundPainter(); |
39 | 74 |
40 // Returns bounds of the screen to use for login wizard. | 75 // Returns bounds of the screen to use for login wizard. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 109 |
75 // Background color of the login controls. | 110 // Background color of the login controls. |
76 const SkColor kBackgroundColor = SK_ColorWHITE; | 111 const SkColor kBackgroundColor = SK_ColorWHITE; |
77 | 112 |
78 // Text color on the login controls. | 113 // Text color on the login controls. |
79 const SkColor kTextColor = SK_ColorWHITE; | 114 const SkColor kTextColor = SK_ColorWHITE; |
80 | 115 |
81 // Default link color on login/OOBE controls. | 116 // Default link color on login/OOBE controls. |
82 const SkColor kLinkColor = 0xFF0066CC; | 117 const SkColor kLinkColor = 0xFF0066CC; |
83 | 118 |
| 119 const int kThrobberRightMargin = 10; |
| 120 |
84 // Default size of the OOBE screen. Includes 10px shadow from each side. | 121 // Default size of the OOBE screen. Includes 10px shadow from each side. |
85 // See rounded_rect_painter.cc for border definitions. | 122 // See rounded_rect_painter.cc for border definitions. |
86 const int kWizardScreenWidth = 800; | 123 const int kWizardScreenWidth = 800; |
87 const int kWizardScreenHeight = 450; | 124 const int kWizardScreenHeight = 450; |
88 | 125 |
89 const int kScreenCornerRadius = 10; | 126 const int kScreenCornerRadius = 10; |
90 const int kUserCornerRadius = 6; | 127 const int kUserCornerRadius = 6; |
91 | 128 |
92 // Username label height in different states. | 129 // Username label height in different states. |
93 const int kSelectedLabelHeight = 25; | 130 const int kSelectedLabelHeight = 25; |
(...skipping 29 matching lines...) Expand all Loading... |
123 | 160 |
124 // New pod sizes. | 161 // New pod sizes. |
125 const int kNewUserPodFullWidth = 372; | 162 const int kNewUserPodFullWidth = 372; |
126 const int kNewUserPodFullHeight = 372; | 163 const int kNewUserPodFullHeight = 372; |
127 const int kNewUserPodSmallWidth = 360; | 164 const int kNewUserPodSmallWidth = 360; |
128 const int kNewUserPodSmallHeight = 322; | 165 const int kNewUserPodSmallHeight = 322; |
129 | 166 |
130 } // namespace chromeos | 167 } // namespace chromeos |
131 | 168 |
132 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ | 169 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
OLD | NEW |