#include "chrome/browser/ui/passwords/manage_passwords_state.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.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_form_manager_for_ui.h"
#include "components/password_manager/core/browser/password_manager.h"
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/password_manager_util.h"
#include "components/password_manager/core/common/password_manager_ui.h"
#include "url/gurl.h"
#include "url/origin.h"
PasswordForm;
PasswordFormManagerForUI;
GetMatchType;
namespace {
std::vector<std::unique_ptr<PasswordForm>> DeepCopyNonPSLVector(
base::span<const PasswordForm> password_forms) { … }
void AppendDeepCopyVector(base::span<const PasswordForm> forms,
std::vector<std::unique_ptr<PasswordForm>>* result) { … }
bool UpdateFormInVector(const PasswordForm& updated_form,
std::vector<std::unique_ptr<PasswordForm>>* forms) { … }
bool RemoveFormFromVector(const PasswordForm& form_to_delete,
std::vector<std::unique_ptr<PasswordForm>>* forms) { … }
}
ManagePasswordsState::ManagePasswordsState()
: … { … }
ManagePasswordsState::~ManagePasswordsState() { … }
void ManagePasswordsState::OnPendingPassword(
std::unique_ptr<PasswordFormManagerForUI> form_manager) { … }
void ManagePasswordsState::OnDefaultStoreChanged(
std::unique_ptr<PasswordFormManagerForUI> form_manager) { … }
void ManagePasswordsState::OnUpdatePassword(
std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager) { … }
void ManagePasswordsState::OnRequestCredentials(
std::vector<std::unique_ptr<PasswordForm>> local_credentials,
const url::Origin& origin) { … }
void ManagePasswordsState::OnAutoSignin(
std::vector<std::unique_ptr<PasswordForm>> local_forms,
const url::Origin& origin) { … }
void ManagePasswordsState::OnAutomaticPasswordSave(
std::unique_ptr<PasswordFormManagerForUI> form_manager) { … }
void ManagePasswordsState::OnSubmittedGeneratedPassword(
password_manager::ui::State state,
std::unique_ptr<password_manager::PasswordFormManagerForUI> form_manager,
password_manager::PasswordForm form_to_update) { … }
void ManagePasswordsState::OnPasswordAutofilled(
base::span<const PasswordForm> password_forms,
url::Origin origin,
base::span<const PasswordForm> federated_matches) { … }
void ManagePasswordsState::OnInactive() { … }
void ManagePasswordsState::OnPasswordMovable(
std::unique_ptr<PasswordFormManagerForUI> form_to_move) { … }
void ManagePasswordsState::OnKeychainError() { … }
void ManagePasswordsState::OnPasskeySaved(bool gpm_pin_created) { … }
void ManagePasswordsState::OnPasskeyDeleted() { … }
void ManagePasswordsState::OnPasskeyUpdated() { … }
void ManagePasswordsState::OnPasskeyNotAccepted() { … }
void ManagePasswordsState::TransitionToState(
password_manager::ui::State state) { … }
void ManagePasswordsState::ProcessLoginsChanged(
const password_manager::PasswordStoreChangeList& changes) { … }
void ManagePasswordsState::ProcessUnsyncedCredentialsWillBeDeleted(
std::vector<password_manager::PasswordForm> unsynced_credentials) { … }
void ManagePasswordsState::ChooseCredential(const PasswordForm* form) { … }
void ManagePasswordsState::OpenPasswordDetailsBubble(
const password_manager::PasswordForm& form) { … }
void ManagePasswordsState::ClearData() { … }
bool ManagePasswordsState::AddForm(const PasswordForm& form) { … }
void ManagePasswordsState::SetState(password_manager::ui::State state) { … }