#include "chrome/browser/extensions/api/passwords_private/passwords_private_api.h"
#include <optional>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate_factory.h"
#include "chrome/common/extensions/api/passwords_private.h"
#include "components/password_manager/core/browser/manage_passwords_referrer.h"
#include "components/password_manager/core/browser/password_manager_util.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/sync/service/sync_service.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function_registry.h"
namespace extensions {
namespace {
ResponseAction;
constexpr char kNoDelegateError[] = …;
constexpr char kPasswordManagerDisabledByPolicy[] = …;
scoped_refptr<PasswordsPrivateDelegate> GetDelegate(
content::BrowserContext* browser_context) { … }
bool IsPasswordManagerDisabledByPolicy(
content::BrowserContext* browser_context) { … }
}
ResponseAction
PasswordsPrivateRecordPasswordsPageAccessInSettingsFunction::Run() { … }
ResponseAction PasswordsPrivateChangeCredentialFunction::Run() { … }
ResponseAction PasswordsPrivateRemoveCredentialFunction::Run() { … }
ResponseAction PasswordsPrivateRemovePasswordExceptionFunction::Run() { … }
ResponseAction
PasswordsPrivateUndoRemoveSavedPasswordOrExceptionFunction::Run() { … }
ResponseAction PasswordsPrivateRequestPlaintextPasswordFunction::Run() { … }
void PasswordsPrivateRequestPlaintextPasswordFunction::GotPassword(
std::optional<std::u16string> password) { … }
ResponseAction PasswordsPrivateRequestCredentialsDetailsFunction::Run() { … }
void PasswordsPrivateRequestCredentialsDetailsFunction::GotPasswords(
const PasswordsPrivateDelegate::UiEntries& entries) { … }
ResponseAction PasswordsPrivateGetSavedPasswordListFunction::Run() { … }
void PasswordsPrivateGetSavedPasswordListFunction::GotList(
const PasswordsPrivateDelegate::UiEntries& list) { … }
ResponseAction PasswordsPrivateGetCredentialGroupsFunction::Run() { … }
ResponseAction PasswordsPrivateGetPasswordExceptionListFunction::Run() { … }
void PasswordsPrivateGetPasswordExceptionListFunction::GotList(
const PasswordsPrivateDelegate::ExceptionEntries& entries) { … }
ResponseAction PasswordsPrivateMovePasswordsToAccountFunction::Run() { … }
ResponseAction PasswordsPrivateFetchFamilyMembersFunction::Run() { … }
ResponseAction PasswordsPrivateSharePasswordFunction::Run() { … }
void PasswordsPrivateFetchFamilyMembersFunction::FamilyFetchCompleted(
const api::passwords_private::FamilyFetchResults& result) { … }
ResponseAction PasswordsPrivateImportPasswordsFunction::Run() { … }
void PasswordsPrivateImportPasswordsFunction::ImportRequestCompleted(
const api::passwords_private::ImportResults& result) { … }
ResponseAction PasswordsPrivateContinueImportFunction::Run() { … }
void PasswordsPrivateContinueImportFunction::ImportCompleted(
const api::passwords_private::ImportResults& result) { … }
ResponseAction PasswordsPrivateResetImporterFunction::Run() { … }
ResponseAction PasswordsPrivateExportPasswordsFunction::Run() { … }
void PasswordsPrivateExportPasswordsFunction::ExportRequestCompleted(
const std::string& error) { … }
ResponseAction PasswordsPrivateRequestExportProgressStatusFunction::Run() { … }
ResponseAction PasswordsPrivateIsOptedInForAccountStorageFunction::Run() { … }
ResponseAction PasswordsPrivateOptInForAccountStorageFunction::Run() { … }
PasswordsPrivateGetInsecureCredentialsFunction::
~PasswordsPrivateGetInsecureCredentialsFunction() = default;
ResponseAction PasswordsPrivateGetInsecureCredentialsFunction::Run() { … }
PasswordsPrivateGetCredentialsWithReusedPasswordFunction::
~PasswordsPrivateGetCredentialsWithReusedPasswordFunction() = default;
ResponseAction PasswordsPrivateGetCredentialsWithReusedPasswordFunction::Run() { … }
PasswordsPrivateMuteInsecureCredentialFunction::
~PasswordsPrivateMuteInsecureCredentialFunction() = default;
ResponseAction PasswordsPrivateMuteInsecureCredentialFunction::Run() { … }
PasswordsPrivateUnmuteInsecureCredentialFunction::
~PasswordsPrivateUnmuteInsecureCredentialFunction() = default;
ResponseAction PasswordsPrivateUnmuteInsecureCredentialFunction::Run() { … }
PasswordsPrivateStartPasswordCheckFunction::
~PasswordsPrivateStartPasswordCheckFunction() = default;
ResponseAction PasswordsPrivateStartPasswordCheckFunction::Run() { … }
void PasswordsPrivateStartPasswordCheckFunction::OnStarted(
password_manager::BulkLeakCheckService::State state) { … }
PasswordsPrivateGetPasswordCheckStatusFunction::
~PasswordsPrivateGetPasswordCheckStatusFunction() = default;
ResponseAction PasswordsPrivateGetPasswordCheckStatusFunction::Run() { … }
ResponseAction PasswordsPrivateIsAccountStoreDefaultFunction::Run() { … }
ResponseAction PasswordsPrivateGetUrlCollectionFunction::Run() { … }
ResponseAction PasswordsPrivateAddPasswordFunction::Run() { … }
ResponseAction PasswordsPrivateExtendAuthValidityFunction::Run() { … }
ResponseAction
PasswordsPrivateSwitchBiometricAuthBeforeFillingStateFunction::Run() { … }
void PasswordsPrivateSwitchBiometricAuthBeforeFillingStateFunction::
OnAuthenticationComplete(bool result) { … }
ResponseAction PasswordsPrivateShowExportedFileInShellFunction::Run() { … }
ResponseAction PasswordsPrivateShowAddShortcutDialogFunction::Run() { … }
ResponseAction PasswordsPrivateChangePasswordManagerPinFunction::Run() { … }
void PasswordsPrivateChangePasswordManagerPinFunction::OnPinChangeCompleted(
bool success) { … }
ResponseAction PasswordsPrivateIsPasswordManagerPinAvailableFunction::Run() { … }
void PasswordsPrivateIsPasswordManagerPinAvailableFunction::
OnPasswordManagerPinAvailabilityReceived(bool is_available) { … }
ResponseAction PasswordsPrivateDisconnectCloudAuthenticatorFunction::Run() { … }
void PasswordsPrivateDisconnectCloudAuthenticatorFunction::
OnDisconnectCloudAuthenticatorCompleted(bool success) { … }
ResponseAction PasswordsPrivateIsConnectedToCloudAuthenticatorFunction::Run() { … }
ResponseAction PasswordsPrivateDeleteAllPasswordManagerDataFunction::Run() { … }
void PasswordsPrivateDeleteAllPasswordManagerDataFunction::OnDeletionCompleted(
bool success) { … }
}