blob: 16c1981e976e559741fe1245cf42f7b9f95fc1fa [file] [log] [blame]
// Copyright 2016 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.
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "components/password_manager/core/browser/hash_password_manager.h"
namespace password_manager {
// Callback interface for receiving a password reuse event.
class PasswordReuseDetectorConsumer
: public base::SupportsWeakPtr<PasswordReuseDetectorConsumer> {
virtual ~PasswordReuseDetectorConsumer();
// Called when a password reuse is found.
// |password_length| is the length of the re-used password, or the max length
// if multiple passwords were matched. |reused_protected_password_hash| is the
// Gaia or enterprise password that matches the reuse. |matching_domains| is
// the list of domains for which |password| is saved (may be empty if
// |reused_protected_password_hash| is not null), |saved_passwords|
// is the total number of passwords (with unique domains) stored in Password
// Manager.
virtual void OnReuseFound(
size_t password_length,
base::Optional<PasswordHashData> reused_protected_password_hash,
const std::vector<std::string>& matching_domains,
int saved_passwords) = 0;
} // namespace password_manager