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