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_SCREEN_LOCK_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/chromeos/login/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual ~ScreenLockView(); | 34 virtual ~ScreenLockView(); |
35 | 35 |
36 void Init(); | 36 void Init(); |
37 | 37 |
38 // Clears and sets the focus to the password field. | 38 // Clears and sets the focus to the password field. |
39 void ClearAndSetFocusToPassword(); | 39 void ClearAndSetFocusToPassword(); |
40 | 40 |
41 // Enable/Disable signout button. | 41 // Enable/Disable signout button. |
42 void SetSignoutEnabled(bool enabled); | 42 void SetSignoutEnabled(bool enabled); |
43 | 43 |
44 // Returns the bounds of the password field in ScreenLocker's coordinate. | |
45 gfx::Rect GetPasswordBoundsRelativeTo(const views::View* view); | |
46 | |
47 // views::View: | 44 // views::View: |
48 virtual void SetEnabled(bool enabled); | 45 virtual void SetEnabled(bool enabled); |
49 virtual void Layout() OVERRIDE; | 46 virtual void Layout() OVERRIDE; |
50 virtual gfx::Size GetPreferredSize() OVERRIDE; | 47 virtual gfx::Size GetPreferredSize() OVERRIDE; |
51 | 48 |
52 // content::NotificationObserver: | 49 // content::NotificationObserver: |
53 virtual void Observe(int type, | 50 virtual void Observe(int type, |
54 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
55 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
56 | 53 |
57 // views::TextfieldController: | 54 // views::TextfieldController: |
58 virtual void ContentsChanged(views::Textfield* sender, | 55 virtual void ContentsChanged(views::Textfield* sender, |
59 const string16& new_contents) OVERRIDE; | 56 const string16& new_contents) OVERRIDE; |
60 virtual bool HandleKeyEvent(views::Textfield* sender, | 57 virtual bool HandleKeyEvent(views::Textfield* sender, |
61 const views::KeyEvent& keystroke) OVERRIDE; | 58 const views::KeyEvent& keystroke) OVERRIDE; |
62 | 59 |
63 // UserView::Delegate: | 60 // UserView::Delegate: |
64 virtual void OnSignout() OVERRIDE; | 61 virtual void OnSignout() OVERRIDE; |
65 virtual bool IsUserSelected() const OVERRIDE; | 62 virtual bool IsUserSelected() const OVERRIDE; |
66 | 63 |
| 64 views::Textfield* password_field() { return password_field_; } |
| 65 |
67 private: | 66 private: |
68 friend class test::ScreenLockerTester; | 67 friend class test::ScreenLockerTester; |
69 | 68 |
70 UserView* user_view_; | 69 UserView* user_view_; |
71 | 70 |
72 // For editing the password. | 71 // For editing the password. |
73 views::Textfield* password_field_; | 72 views::Textfield* password_field_; |
74 | 73 |
75 // ScreenLocker is owned by itself. | 74 // ScreenLocker is owned by itself. |
76 ScreenLocker* screen_locker_; | 75 ScreenLocker* screen_locker_; |
77 | 76 |
78 content::NotificationRegistrar registrar_; | 77 content::NotificationRegistrar registrar_; |
79 | 78 |
80 // User's picture, signout button and password field. | 79 // User's picture, signout button and password field. |
81 views::View* main_; | 80 views::View* main_; |
82 | 81 |
83 // Username that overlays on top of user's picture. | 82 // Username that overlays on top of user's picture. |
84 views::View* username_; | 83 views::View* username_; |
85 | 84 |
86 DISALLOW_COPY_AND_ASSIGN(ScreenLockView); | 85 DISALLOW_COPY_AND_ASSIGN(ScreenLockView); |
87 }; | 86 }; |
88 | 87 |
89 } // namespace chromeos | 88 } // namespace chromeos |
90 | 89 |
91 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ |
OLD | NEW |