Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: components/password_manager/core/browser/hsts_deleter.h

Issue 2673053002: Obsolete HTTP Cleaner (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/hsts_deleter.h
diff --git a/components/password_manager/core/browser/hsts_deleter.h b/components/password_manager/core/browser/hsts_deleter.h
new file mode 100644
index 0000000000000000000000000000000000000000..fa40fde5e135bd61e5817988f7edf194a70d39e8
--- /dev/null
+++ b/components/password_manager/core/browser/hsts_deleter.h
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_
+#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_
+
+#include <memory>
+#include <vector>
+
+#include "base/macros.h"
+#include "components/password_manager/core/browser/password_store_consumer.h"
+
+namespace autofill {
+struct PasswordForm;
+}
+
+namespace password_manager {
+
+struct InteractionsStats;
+class PasswordManagerClient;
+class PasswordStore;
+
+class HstsDeleter : public PasswordStoreConsumer {
+ public:
+ HstsDeleter(const PasswordManagerClient* client,
+ PasswordStore* password_store);
+
+ // PasswordStoreConsumer:
+ // This will be called for both autofillable logins as well as blacklisted
+ // logins. Blacklisted logins are removed iff the scheme is HTTP and HSTS is
+ // enabled for the host.
+ // Autofillable logins are removed iff the scheme is HTTP and there exists
+ // another HTTPS login with active HSTS that has the same host as well as the
+ // same username and password.
+ void OnGetPasswordStoreResults(
+ std::vector<std::unique_ptr<autofill::PasswordForm>> results) override;
+
+ // This will remove all stats for HTTP sites for which HSTS is active.
+ void OnGetSiteStatistics(std::vector<InteractionsStats> stats) override;
+
+ private:
+ const PasswordManagerClient* const client_;
+ PasswordStore* password_store_;
+
+ DISALLOW_COPY_AND_ASSIGN(HstsDeleter);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HSTS_DELETER_H_

Powered by Google App Engine
This is Rietveld 408576698