OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // User requested enterprise enrollment. | 53 // User requested enterprise enrollment. |
54 virtual void OnStartEnterpriseEnrollment() = 0; | 54 virtual void OnStartEnterpriseEnrollment() = 0; |
55 | 55 |
56 // User started typing so clear all error messages. | 56 // User started typing so clear all error messages. |
57 virtual void ClearErrors() = 0; | 57 virtual void ClearErrors() = 0; |
58 | 58 |
59 // User tries to navigate away from NewUserView pod. | 59 // User tries to navigate away from NewUserView pod. |
60 virtual void NavigateAway() = 0; | 60 virtual void NavigateAway() = 0; |
61 }; | 61 }; |
62 | 62 |
63 // If |need_border| is true, RoundedRect border and background are required. | 63 NewUserView(Delegate* delegate, bool need_guest_link); |
64 NewUserView(Delegate* delegate, | |
65 bool need_border, | |
66 bool need_guest_link); | |
67 | 64 |
68 virtual ~NewUserView(); | 65 virtual ~NewUserView(); |
69 | 66 |
70 // Initialize view layout. | 67 // Initialize view layout. |
71 void Init(); | 68 void Init(); |
72 | 69 |
73 // Update strings from the resources. Executed on language change. | 70 // Update strings from the resources. Executed on language change. |
74 void UpdateLocalizedStringsAndFonts(); | 71 void UpdateLocalizedStringsAndFonts(); |
75 | 72 |
76 // Returns bounds of password field in screen coordinates. | 73 // Returns bounds of password field in screen coordinates. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 protected: | 119 protected: |
123 // views::View: | 120 // views::View: |
124 virtual void ViewHierarchyChanged(bool is_add, | 121 virtual void ViewHierarchyChanged(bool is_add, |
125 views::View *parent, | 122 views::View *parent, |
126 views::View *child); | 123 views::View *child); |
127 virtual void OnLocaleChanged(); | 124 virtual void OnLocaleChanged(); |
128 void AddChildView(View* view); | 125 void AddChildView(View* view); |
129 | 126 |
130 private: | 127 private: |
131 // Creates Link control and adds it as a child. | 128 // Creates Link control and adds it as a child. |
132 void InitLink(views::Link** link); | 129 views::Link* InitLink(SkColor background_color); |
133 | 130 |
134 // Delete and recreate native controls that fail to update preferred size | 131 // Delete and recreate native controls that fail to update preferred size |
135 // after text/locale update. | 132 // after text/locale update. |
136 void RecreatePeculiarControls(); | 133 void RecreatePeculiarControls(); |
137 | 134 |
138 // Enable or disable the |sign_in_button_| based on the contents of the | 135 // Enable or disable the |sign_in_button_| based on the contents of the |
139 // |username_field_| and |password_field_|. If there is text in both the | 136 // |username_field_| and |password_field_|. If there is text in both the |
140 // button is enabled, otherwise it's disabled. | 137 // button is enabled, otherwise it's disabled. |
141 void UpdateSignInButtonState(); | 138 void UpdateSignInButtonState(); |
142 | 139 |
(...skipping 26 matching lines...) Expand all Loading... |
169 // Notifications receiver. | 166 // Notifications receiver. |
170 Delegate* delegate_; | 167 Delegate* delegate_; |
171 | 168 |
172 base::WeakPtrFactory<NewUserView> weak_factory_; | 169 base::WeakPtrFactory<NewUserView> weak_factory_; |
173 | 170 |
174 LanguageSwitchMenu language_switch_menu_; | 171 LanguageSwitchMenu language_switch_menu_; |
175 | 172 |
176 // True when login is in process. | 173 // True when login is in process. |
177 bool login_in_process_; | 174 bool login_in_process_; |
178 | 175 |
179 // If true, this view needs RoundedRect border and background. | |
180 bool need_border_; | |
181 | |
182 // Whether Guest Mode link is needed. | 176 // Whether Guest Mode link is needed. |
183 bool need_guest_link_; | 177 bool need_guest_link_; |
184 | 178 |
185 // Whether create account link is needed. Set to false for now but we may | 179 // Whether create account link is needed. Set to false for now but we may |
186 // need it back in near future. | 180 // need it back in near future. |
187 bool need_create_account_; | 181 bool need_create_account_; |
188 | 182 |
189 // Ordinal position of controls inside view layout. | 183 // Ordinal position of controls inside view layout. |
190 int languages_menubutton_order_; | 184 int languages_menubutton_order_; |
191 int sign_in_button_order_; | 185 int sign_in_button_order_; |
192 | 186 |
193 DISALLOW_COPY_AND_ASSIGN(NewUserView); | 187 DISALLOW_COPY_AND_ASSIGN(NewUserView); |
194 }; | 188 }; |
195 | 189 |
196 } // namespace chromeos | 190 } // namespace chromeos |
197 | 191 |
198 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ | 192 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_NEW_USER_VIEW_H_ |
OLD | NEW |