OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace password_manager { | 23 namespace password_manager { |
24 | 24 |
25 class PasswordReuseDetectorConsumer; | 25 class PasswordReuseDetectorConsumer; |
26 | 26 |
27 // Comparator that compares reversed strings. | 27 // Comparator that compares reversed strings. |
28 struct ReverseStringLess { | 28 struct ReverseStringLess { |
29 bool operator()(const base::string16& lhs, const base::string16& rhs) const; | 29 bool operator()(const base::string16& lhs, const base::string16& rhs) const; |
30 }; | 30 }; |
31 | 31 |
| 32 // Used to identify chrome sync password in password entry event. |
| 33 extern const char kSyncPasswordDomain[]; |
| 34 |
32 // Per-profile class responsible for detection of password reuse, i.e. that the | 35 // Per-profile class responsible for detection of password reuse, i.e. that the |
33 // user input on some site contains the password saved on another site. | 36 // user input on some site contains the password saved on another site. |
34 // It receives saved passwords through PasswordStoreConsumer interface. | 37 // It receives saved passwords through PasswordStoreConsumer interface. |
35 // It stores passwords in memory and CheckReuse() can be used for finding | 38 // It stores passwords in memory and CheckReuse() can be used for finding |
36 // a password reuse. | 39 // a password reuse. |
37 class PasswordReuseDetector : public PasswordStoreConsumer { | 40 class PasswordReuseDetector : public PasswordStoreConsumer { |
38 public: | 41 public: |
39 explicit PasswordReuseDetector(PrefService* prefs); | 42 explicit PasswordReuseDetector(PrefService* prefs); |
40 ~PasswordReuseDetector() override; | 43 ~PasswordReuseDetector() override; |
41 | 44 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 101 |
99 base::Optional<uint64_t> sync_password_hash_; | 102 base::Optional<uint64_t> sync_password_hash_; |
100 PrefService* const prefs_; | 103 PrefService* const prefs_; |
101 | 104 |
102 DISALLOW_COPY_AND_ASSIGN(PasswordReuseDetector); | 105 DISALLOW_COPY_AND_ASSIGN(PasswordReuseDetector); |
103 }; | 106 }; |
104 | 107 |
105 } // namespace password_manager | 108 } // namespace password_manager |
106 | 109 |
107 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ | 110 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_H_ |
OLD | NEW |