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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/chromeos/login/user_input.h" | |
9 #include "views/accelerator.h" | 10 #include "views/accelerator.h" |
10 #include "views/controls/button/native_button.h" | 11 #include "views/controls/button/native_button.h" |
11 #include "views/controls/textfield/textfield.h" | 12 #include "views/controls/textfield/textfield.h" |
12 #include "views/view.h" | 13 #include "views/view.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace chromeos { |
15 | 16 |
16 class UserController; | 17 class UserController; |
17 | 18 |
18 class ExistingUserView : public views::View { | 19 class ExistingUserView : public UserInput, |
20 public views::Textfield::Controller, | |
21 public views::View { | |
19 public: | 22 public: |
20 explicit ExistingUserView(UserController* uc); | 23 explicit ExistingUserView(UserController* user_controller); |
21 | 24 |
22 void RecreateFields(); | 25 void RecreateFields(); |
23 | 26 |
24 views::Textfield* password_field() { return password_field_; } | |
25 | |
26 void FocusPasswordField(); | 27 void FocusPasswordField(); |
27 | 28 |
28 // Overridden from views::View: | 29 // Overridden from views::View: |
29 virtual bool AcceleratorPressed(const views::Accelerator& accelerator); | 30 virtual bool AcceleratorPressed(const views::Accelerator& accelerator); |
30 | 31 |
32 // Textfield::Controller: | |
whywhat
2010/12/09 16:20:18
Could you use consistent "Overridden from " prefix
altimofeev
2010/12/10 16:37:40
Done.
| |
33 virtual void ContentsChanged(views::Textfield* sender, | |
34 const string16& new_contents); | |
35 | |
36 virtual bool HandleKeystroke(views::Textfield* sender, | |
37 const views::Textfield::Keystroke& keystroke); | |
38 | |
39 // Implements UserInput: | |
40 virtual void EnableInputControls(bool enabled); | |
41 | |
42 virtual void ClearAndFocusControls(); | |
43 | |
44 virtual void ClearAndFocusPassword(); | |
45 | |
46 virtual gfx::Rect GetControlWithErrorBounds() const; | |
47 | |
48 virtual bool UseCustomBoundsForThrobber(const gfx::Size& throbber, | |
49 gfx::Rect* bounds) const; | |
50 | |
31 protected: | 51 protected: |
32 // Overridden from views::View: | 52 // Overridden from views::View: |
33 virtual void OnLocaleChanged(); | 53 virtual void OnLocaleChanged(); |
54 | |
34 virtual void ViewHierarchyChanged(bool is_add, | 55 virtual void ViewHierarchyChanged(bool is_add, |
35 views::View* parent, | 56 views::View* parent, |
36 views::View* child); | 57 views::View* child); |
37 | 58 |
38 views::Accelerator accel_login_off_the_record_; | 59 private: |
60 UserController* user_controller_; | |
39 | 61 |
40 // For editing the password. | 62 // For editing the password. |
41 views::Textfield* password_field_; | 63 views::Textfield* password_field_; |
42 | 64 |
43 UserController* user_controller_; | 65 views::Accelerator accel_login_off_the_record_; |
44 | |
45 private: | |
46 views::Accelerator accel_enable_accessibility_; | 66 views::Accelerator accel_enable_accessibility_; |
47 | 67 |
48 DISALLOW_COPY_AND_ASSIGN(ExistingUserView); | 68 DISALLOW_COPY_AND_ASSIGN(ExistingUserView); |
49 }; | 69 }; |
50 | 70 |
51 } // chromeos | 71 } // chromeos |
52 | 72 |
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ | 73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ |
OLD | NEW |