#include "chrome/browser/ui/webui/password_manager/promo_cards_handler.h"
#include <memory>
#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate_factory.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/ui/webui/password_manager/promo_card.h"
#include "chrome/grit/generated_resources.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/browser/ui/webui/password_manager/promo_cards/access_on_any_device_promo.h"
#include "chrome/browser/ui/webui/password_manager/promo_cards/move_passwords_promo.h"
#include "chrome/browser/ui/webui/password_manager/promo_cards/password_checkup_promo.h"
#include "chrome/browser/ui/webui/password_manager/promo_cards/password_manager_shortcut_promo.h"
#include "chrome/browser/ui/webui/password_manager/promo_cards/web_password_manager_promo.h"
#endif
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/password_manager/promo_cards/relaunch_chrome_promo.h"
#endif
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#include "chrome/browser/ui/webui/password_manager/promo_cards/screenlock_reauth_promo.h"
#endif
namespace password_manager {
namespace {
base::Value::Dict PromoCardToValueDict(
const PasswordPromoCardBase* promo_card) { … }
std::vector<std::unique_ptr<PasswordPromoCardBase>> GetAllPromoCardsForProfile(
Profile* profile) { … }
}
PromoCardsHandler::PromoCardsHandler(Profile* profile) : … { … }
PromoCardsHandler::PromoCardsHandler(
base::PassKey<class PromoCardsHandlerTest>,
Profile* profile,
std::vector<std::unique_ptr<PasswordPromoCardBase>> promo_cards)
: … { … }
PromoCardsHandler::~PromoCardsHandler() = default;
void PromoCardsHandler::RegisterMessages() { … }
void PromoCardsHandler::RestartChrome(const base::Value::List& args) { … }
void PromoCardsHandler::HandleGetAvailablePromoCard(
const base::Value::List& args) { … }
void PromoCardsHandler::HandleRecordPromoDismissed(
const base::Value::List& args) { … }
PasswordPromoCardBase* PromoCardsHandler::GetPromoToShowAndUpdatePref() { … }
}