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_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 "chrome/browser/chromeos/login/user_view.h" | 9 #include "chrome/browser/chromeos/login/user_view.h" |
10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
12 #include "views/controls/textfield/textfield.h" | 12 #include "views/controls/textfield/textfield.h" |
13 #include "views/view.h" | 13 #include "views/view.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class ImageView; | 16 class ImageView; |
17 } // namespace views | 17 } // namespace views |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 class ScreenLocker; | 21 class ScreenLocker; |
22 class ThrobberWidget; | |
22 class UserView; | 23 class UserView; |
23 | 24 |
24 namespace test { | 25 namespace test { |
25 class ScreenLockerTester; | 26 class ScreenLockerTester; |
26 } // namespace test | 27 } // namespace test |
27 | 28 |
28 // ScreenLockView creates view components necessary to authenticate | 29 // ScreenLockView creates view components necessary to authenticate |
29 // a user to unlock the screen. | 30 // a user to unlock the screen. |
30 class ScreenLockView : public views::View, | 31 class ScreenLockView : public views::View, |
31 public views::Textfield::Controller, | 32 public views::Textfield::Controller, |
32 public NotificationObserver, | 33 public NotificationObserver, |
33 public UserView::Delegate { | 34 public UserView::Delegate { |
34 public: | 35 public: |
35 explicit ScreenLockView(ScreenLocker* screen_locker); | 36 explicit ScreenLockView(ScreenLocker* screen_locker); |
36 virtual ~ScreenLockView() {} | 37 virtual ~ScreenLockView() {} |
37 | 38 |
38 void Init(); | 39 void Init(); |
39 | 40 |
40 // Clears and sets the focus to the password field. | 41 // Clears and sets the focus to the password field. |
41 void ClearAndSetFocusToPassword(); | 42 void ClearAndSetFocusToPassword(); |
42 | 43 |
43 // Enable/Disable signout button. | 44 // Enable/Disable signout button. |
44 void SetSignoutEnabled(bool enabled); | 45 void SetSignoutEnabled(bool enabled); |
45 | 46 |
46 // Returns the bounds of the password field in ScreenLocker's coordinate. | 47 // Returns the bounds of the password field in ScreenLocker's coordinate. |
47 gfx::Rect GetPasswordBoundsRelativeTo(const views::View* view); | 48 gfx::Rect GetPasswordBoundsRelativeTo(const views::View* view); |
48 | 49 |
50 // Returns widget under which throbber should be shown. NULL if there is no | |
whywhat
2010/12/09 16:20:18
"under which ..." should be "which ... under". Als
altimofeev
2010/12/10 16:37:40
Above. Fixed.
| |
51 // such widget yet. | |
52 views::Widget* GetWidgetForThrobber(); | |
53 | |
49 // views::View implementation: | 54 // views::View implementation: |
50 virtual void SetEnabled(bool enabled); | 55 virtual void SetEnabled(bool enabled); |
51 virtual void Layout(); | 56 virtual void Layout(); |
52 virtual gfx::Size GetPreferredSize(); | 57 virtual gfx::Size GetPreferredSize(); |
53 | 58 |
54 // NotificationObserver implementation: | 59 // NotificationObserver implementation: |
55 virtual void Observe(NotificationType type, | 60 virtual void Observe(NotificationType type, |
56 const NotificationSource& source, | 61 const NotificationSource& source, |
57 const NotificationDetails& details); | 62 const NotificationDetails& details); |
58 | 63 |
(...skipping 24 matching lines...) Expand all Loading... | |
83 ScreenLocker* screen_locker_; | 88 ScreenLocker* screen_locker_; |
84 | 89 |
85 NotificationRegistrar registrar_; | 90 NotificationRegistrar registrar_; |
86 | 91 |
87 // User's picture, signout button and password field. | 92 // User's picture, signout button and password field. |
88 views::View* main_; | 93 views::View* main_; |
89 | 94 |
90 // Username that overlays on top of user's picture. | 95 // Username that overlays on top of user's picture. |
91 views::View* username_; | 96 views::View* username_; |
92 | 97 |
98 // Throbber that is shown when the logging is in progress. | |
99 ThrobberWidget* throbber_widget_; | |
100 | |
93 DISALLOW_COPY_AND_ASSIGN(ScreenLockView); | 101 DISALLOW_COPY_AND_ASSIGN(ScreenLockView); |
94 }; | 102 }; |
95 | 103 |
96 } // namespace chromeos | 104 } // namespace chromeos |
97 | 105 |
98 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCK_VIEW_H_ |
OLD | NEW |