OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LOCK_SCREEN_LOCKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 // Returns the tester | 124 // Returns the tester |
125 static test::ScreenLockerTester* GetTester(); | 125 static test::ScreenLockerTester* GetTester(); |
126 | 126 |
127 private: | 127 private: |
128 friend class base::DeleteHelper<ScreenLocker>; | 128 friend class base::DeleteHelper<ScreenLocker>; |
129 friend class test::ScreenLockerTester; | 129 friend class test::ScreenLockerTester; |
130 friend class test::ScreenLockerViewsTester; | 130 friend class test::ScreenLockerViewsTester; |
131 friend class test::WebUIScreenLockerTester; | 131 friend class test::WebUIScreenLockerTester; |
132 friend class ScreenLockerDelegate; | 132 friend class ScreenLockerDelegate; |
133 | 133 |
134 enum UnlockType { AUTH_PASSWORD = 0, AUTH_PIN, AUTH_COUNT }; | |
jdufault
2016/08/18 17:48:50
There's a semi-standard comment block that is put
| |
135 | |
134 struct AuthenticationParametersCapture { | 136 struct AuthenticationParametersCapture { |
135 UserContext user_context; | 137 UserContext user_context; |
136 }; | 138 }; |
137 | 139 |
138 ~ScreenLocker() override; | 140 ~ScreenLocker() override; |
139 | 141 |
140 // Sets the authenticator. | 142 // Sets the authenticator. |
141 void SetAuthenticator(Authenticator* authenticator); | 143 void SetAuthenticator(Authenticator* authenticator); |
142 | 144 |
143 // Called when the screen lock is ready. | 145 // Called when the screen lock is ready. |
(...skipping 16 matching lines...) Expand all Loading... | |
160 | 162 |
161 // Used to authenticate the user to unlock. | 163 // Used to authenticate the user to unlock. |
162 scoped_refptr<Authenticator> authenticator_; | 164 scoped_refptr<Authenticator> authenticator_; |
163 | 165 |
164 // Used to authenticate the user to unlock supervised users. | 166 // Used to authenticate the user to unlock supervised users. |
165 scoped_refptr<ExtendedAuthenticator> extended_authenticator_; | 167 scoped_refptr<ExtendedAuthenticator> extended_authenticator_; |
166 | 168 |
167 // True if the screen is locked, or false otherwise. This changes | 169 // True if the screen is locked, or false otherwise. This changes |
168 // from false to true, but will never change from true to | 170 // from false to true, but will never change from true to |
169 // false. Instead, ScreenLocker object gets deleted when unlocked. | 171 // false. Instead, ScreenLocker object gets deleted when unlocked. |
170 bool locked_; | 172 bool locked_ = false; |
171 | 173 |
172 // Reference to the single instance of the screen locker object. | 174 // Reference to the single instance of the screen locker object. |
173 // This is used to make sure there is only one screen locker instance. | 175 // This is used to make sure there is only one screen locker instance. |
174 static ScreenLocker* screen_locker_; | 176 static ScreenLocker* screen_locker_; |
175 | 177 |
176 // The time when the screen locker object is created. | 178 // The time when the screen locker object is created. |
177 base::Time start_time_; | 179 base::Time start_time_ = base::Time::Now(); |
178 // The time when the authentication is started. | 180 // The time when the authentication is started. |
179 base::Time authentication_start_time_; | 181 base::Time authentication_start_time_; |
180 | 182 |
181 // Delegate to forward all login status events to. | 183 // Delegate to forward all login status events to. |
182 // Tests can use this to receive login status events. | 184 // Tests can use this to receive login status events. |
183 AuthStatusConsumer* auth_status_consumer_; | 185 AuthStatusConsumer* auth_status_consumer_ = nullptr; |
184 | 186 |
185 // Number of bad login attempts in a row. | 187 // Number of bad login attempts in a row. |
186 int incorrect_passwords_count_; | 188 int incorrect_passwords_count_ = 0; |
189 | |
190 // Whether the last password entered was a pin or not. | |
191 bool is_pin_attempt_ = false; | |
187 | 192 |
188 // Copy of parameters passed to last call of OnLoginSuccess for usage in | 193 // Copy of parameters passed to last call of OnLoginSuccess for usage in |
189 // UnlockOnLoginSuccess(). | 194 // UnlockOnLoginSuccess(). |
190 std::unique_ptr<AuthenticationParametersCapture> authentication_capture_; | 195 std::unique_ptr<AuthenticationParametersCapture> authentication_capture_; |
191 | 196 |
192 // Provider for button icon set by the screenlockPrivate API. | 197 // Provider for button icon set by the screenlockPrivate API. |
193 std::unique_ptr<ScreenlockIconProvider> screenlock_icon_provider_; | 198 std::unique_ptr<ScreenlockIconProvider> screenlock_icon_provider_; |
194 | 199 |
195 scoped_refptr<input_method::InputMethodManager::State> saved_ime_state_; | 200 scoped_refptr<input_method::InputMethodManager::State> saved_ime_state_; |
196 | 201 |
197 base::WeakPtrFactory<ScreenLocker> weak_factory_; | 202 base::WeakPtrFactory<ScreenLocker> weak_factory_; |
198 | 203 |
199 DISALLOW_COPY_AND_ASSIGN(ScreenLocker); | 204 DISALLOW_COPY_AND_ASSIGN(ScreenLocker); |
200 }; | 205 }; |
201 | 206 |
202 } // namespace chromeos | 207 } // namespace chromeos |
203 | 208 |
204 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_H_ | 209 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_H_ |
OLD | NEW |