| 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // registry controlled domain than |domain|. | 254 // registry controlled domain than |domain|. |
| 255 // If such suffix is found, |consumer|->OnReuseFound() is called on the same | 255 // If such suffix is found, |consumer|->OnReuseFound() is called on the same |
| 256 // thread on which this method is called. | 256 // thread on which this method is called. |
| 257 // |consumer| must not be null. | 257 // |consumer| must not be null. |
| 258 virtual void CheckReuse(const base::string16& input, | 258 virtual void CheckReuse(const base::string16& input, |
| 259 const std::string& domain, | 259 const std::string& domain, |
| 260 PasswordReuseDetectorConsumer* consumer); | 260 PasswordReuseDetectorConsumer* consumer); |
| 261 | 261 |
| 262 // Saves a hash of |password| for password reuse checking. | 262 // Saves a hash of |password| for password reuse checking. |
| 263 void SaveSyncPasswordHash(const base::string16& password); | 263 void SaveSyncPasswordHash(const base::string16& password); |
| 264 |
| 265 // Clears the saved sync password hash. |
| 266 void ClearSyncPasswordHash(); |
| 264 #endif | 267 #endif |
| 265 | 268 |
| 266 protected: | 269 protected: |
| 267 friend class base::RefCountedThreadSafe<PasswordStore>; | 270 friend class base::RefCountedThreadSafe<PasswordStore>; |
| 268 | 271 |
| 269 typedef base::Callback<PasswordStoreChangeList(void)> ModificationTask; | 272 typedef base::Callback<PasswordStoreChangeList(void)> ModificationTask; |
| 270 | 273 |
| 271 // Represents a single GetLogins() request. Implements functionality to filter | 274 // Represents a single GetLogins() request. Implements functionality to filter |
| 272 // results and send them to the consumer on the consumer's message loop. | 275 // results and send them to the consumer on the consumer's message loop. |
| 273 class GetLoginsRequest { | 276 class GetLoginsRequest { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 426 |
| 424 // TODO(crbug.com/706392): Fix password reuse detection for Android. | 427 // TODO(crbug.com/706392): Fix password reuse detection for Android. |
| 425 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 428 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 426 // Synchronous implementation of CheckReuse(). | 429 // Synchronous implementation of CheckReuse(). |
| 427 void CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, | 430 void CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, |
| 428 const base::string16& input, | 431 const base::string16& input, |
| 429 const std::string& domain); | 432 const std::string& domain); |
| 430 | 433 |
| 431 // Synchronous implementation of SaveSyncPasswordHash(). | 434 // Synchronous implementation of SaveSyncPasswordHash(). |
| 432 void SaveSyncPasswordHashImpl(const base::string16& password); | 435 void SaveSyncPasswordHashImpl(const base::string16& password); |
| 436 |
| 437 // Synchronous implementation of ClearSyncPasswordHash(). |
| 438 void ClearSyncPasswordHashImpl(); |
| 433 #endif | 439 #endif |
| 434 | 440 |
| 435 // TaskRunner for tasks that run on the main thread (usually the UI thread). | 441 // TaskRunner for tasks that run on the main thread (usually the UI thread). |
| 436 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_; | 442 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_; |
| 437 | 443 |
| 438 // TaskRunner for the DB thread. By default, this is the task runner used for | 444 // TaskRunner for the DB thread. By default, this is the task runner used for |
| 439 // background tasks -- see |GetBackgroundTaskRunner|. | 445 // background tasks -- see |GetBackgroundTaskRunner|. |
| 440 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner_; | 446 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner_; |
| 441 | 447 |
| 442 private: | 448 private: |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 DISALLOW_COPY_AND_ASSIGN(PasswordStore); | 606 DISALLOW_COPY_AND_ASSIGN(PasswordStore); |
| 601 }; | 607 }; |
| 602 | 608 |
| 603 // For logging only. | 609 // For logging only. |
| 604 std::ostream& operator<<(std::ostream& os, | 610 std::ostream& operator<<(std::ostream& os, |
| 605 const PasswordStore::FormDigest& digest); | 611 const PasswordStore::FormDigest& digest); |
| 606 | 612 |
| 607 } // namespace password_manager | 613 } // namespace password_manager |
| 608 | 614 |
| 609 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 615 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
| OLD | NEW |