#include "components/safe_browsing/core/browser/password_protection/password_reuse_detection_manager.h"
#include <optional>
#include "base/time/default_clock.h"
#include "build/build_config.h"
#include "components/autofill/core/browser/logging/log_manager.h"
#include "components/password_manager/core/browser/browser_save_password_progress_logger.h"
#include "components/password_manager/core/browser/password_reuse_manager.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/core/browser/password_protection/password_reuse_detection_manager_client.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
Time;
namespace safe_browsing {
namespace {
constexpr size_t kMaxNumberOfCharactersToStore = …;
constexpr base::TimeDelta kMaxInactivityTime = …;
}
PasswordReuseDetectionManager::PasswordReuseDetectionManager(
PasswordReuseDetectionManagerClient* client)
: … { … }
PasswordReuseDetectionManager::~PasswordReuseDetectionManager() = default;
void PasswordReuseDetectionManager::DidNavigateMainFrame(
const GURL& main_frame_url) { … }
void PasswordReuseDetectionManager::OnKeyPressedCommitted(
const std::u16string& text) { … }
#if BUILDFLAG(IS_ANDROID)
void PasswordReuseDetectionManager::OnKeyPressedUncommitted(
const std::u16string& text) {
OnKeyPressed(text, false);
}
#endif
void PasswordReuseDetectionManager::OnKeyPressed(const std::u16string& text,
bool is_committed) { … }
void PasswordReuseDetectionManager::OnPaste(std::u16string text) { … }
void PasswordReuseDetectionManager::OnReuseCheckDone(
bool is_reuse_found,
size_t password_length,
std::optional<password_manager::PasswordHashData>
reused_protected_password_hash,
const std::vector<password_manager::MatchingReusedCredential>&
matching_reused_credentials,
int saved_passwords,
const std::string& domain,
uint64_t reused_password_hash) { … }
base::WeakPtr<password_manager::PasswordReuseDetectorConsumer>
PasswordReuseDetectionManager::AsWeakPtr() { … }
void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) { … }
password_manager::metrics_util::PasswordType
PasswordReuseDetectionManager::GetReusedPasswordType(
std::optional<password_manager::PasswordHashData>
reused_protected_password_hash,
size_t matching_domain_count) { … }
void PasswordReuseDetectionManager::CheckStoresForReuse(
const std::u16string& input) { … }
}