Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_ | |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "components/password_manager/core/browser/password_store_consumer.h" | |
| 13 | |
| 14 namespace autofill { | |
| 15 struct PasswordForm; | |
| 16 } | |
| 17 | |
| 18 namespace password_manager { | |
| 19 | |
| 20 struct InteractionsStats; | |
| 21 class PasswordManagerClient; | |
| 22 class PasswordStore; | |
| 23 | |
| 24 class HstsDeleter : public PasswordStoreConsumer { | |
|
vasilii
2017/02/06 16:43:24
A comment? The name isn't clear at all. The class
jdoerrie
2017/02/07 13:15:02
Done.
| |
| 25 public: | |
| 26 HstsDeleter(const PasswordManagerClient* client, | |
| 27 PasswordStore* password_store); | |
|
vasilii
2017/02/06 16:43:24
You can get the password store from the client wit
jdoerrie
2017/02/07 13:15:01
Done.
| |
| 28 | |
|
vasilii
2017/02/06 16:43:24
A virtual destructor?
jdoerrie
2017/02/07 13:15:00
Done.
| |
| 29 // PasswordStoreConsumer: | |
| 30 // This will be called for both autofillable logins as well as blacklisted | |
| 31 // logins. Blacklisted logins are removed iff the scheme is HTTP and HSTS is | |
| 32 // enabled for the host. | |
| 33 // Autofillable logins are removed iff the scheme is HTTP and there exists | |
| 34 // another HTTPS login with active HSTS that has the same host as well as the | |
| 35 // same username and password. | |
| 36 void OnGetPasswordStoreResults( | |
| 37 std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; | |
| 38 | |
| 39 // This will remove all stats for HTTP sites for which HSTS is active. | |
| 40 void OnGetSiteStatistics(std::vector<InteractionsStats> stats) override; | |
| 41 | |
| 42 private: | |
| 43 const PasswordManagerClient* const client_; | |
| 44 PasswordStore* password_store_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(HstsDeleter); | |
| 47 }; | |
| 48 | |
| 49 } // namespace password_manager | |
| 50 | |
| 51 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_ | |
| OLD | NEW |