| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // The local-auth module allows for user authentication in the case when | 5 // The local-auth module allows for user authentication in the case when |
| 6 // on-line authentication is not possible (e.g. there is no network | 6 // on-line authentication is not possible (e.g. there is no network |
| 7 // connection). | 7 // connection). |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ | 9 #ifndef CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ |
| 10 #define CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ | 10 #define CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace user_prefs { | 16 namespace user_prefs { |
| 17 class PrefRegistrySyncable; | 17 class PrefRegistrySyncable; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace chrome { | 20 namespace chrome { |
| 21 | 21 |
| 22 void RegisterLocalAuthPrefs(user_prefs::PrefRegistrySyncable* registry); | 22 void RegisterLocalAuthPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 23 | 23 |
| 24 void SetLocalAuthCredentials(size_t profile_info_index, | 24 void SetLocalAuthCredentials(size_t profile_info_index, |
| 25 const std::string& password); | 25 const std::string& password); |
| 26 | 26 |
| 27 // For use by tests only to ensure backward compatibility. |
| 28 void SetLocalAuthCredentialsWithEncoding(size_t profile_info_index, |
| 29 const std::string& password, |
| 30 char encoding_version); |
| 31 |
| 27 void SetLocalAuthCredentials(const Profile* profile, | 32 void SetLocalAuthCredentials(const Profile* profile, |
| 28 const std::string& password); | 33 const std::string& password); |
| 29 | 34 |
| 30 bool ValidateLocalAuthCredentials(size_t profile_info_index, | 35 bool ValidateLocalAuthCredentials(size_t profile_info_index, |
| 31 const std::string& password); | 36 const std::string& password); |
| 32 | 37 |
| 33 bool ValidateLocalAuthCredentials(const Profile* profile, | 38 bool ValidateLocalAuthCredentials(const Profile* profile, |
| 34 const std::string& password); | 39 const std::string& password); |
| 35 | 40 |
| 41 // Return only the first |len_bits| bits of the string |str|. |
| 42 std::string TruncateStringByBits(const std::string& str, const size_t len_bits); |
| 43 |
| 36 } // namespace chrome | 44 } // namespace chrome |
| 37 | 45 |
| 38 #endif // CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ | 46 #endif // CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ |
| OLD | NEW |